Derive from existing control in VC++

D

Dirk Schippers

I thought this would be easy, but I can't get it to work.
I want to create my custom panel class that inherits from the
System::Windows::Forms::panel class. I find a lot of examples and
explanations about how to do it in VB and VC#, but not in VC++.

Can anyone help me with this?

My experience with it that whatever I do, create a simple class
inheriting from System::Windows::Forms::panel or create a User Control
and change its inheritance from System::Windows::Forms::UserControl to
System::Windows::Forms::panel, I can't seem to add it in the toolbox or
change the design-code manually to make it use my control.

The design mode then gives an error that the control can't be found even
though everything compiles and runs perfectly. Help tells me something
about references that should be added but when I look into the add
references place in the project settings, I can't find my user control
there to add it.

So, it seems to run fine, but the design mode no longer works then,
which is of course not very handy to work with.

Anyone?
 
X

xcal

sometimes from Csharp you need only to replace

. by :: for namespaces

. for -> for structures, etc,

and to write System.Windows.Forms.Panel instead of only Panel.
If you create your own control, try placing it on a different .h file
and calling it using include.

hope this helps, Carlos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top