Derive from existing control in VC++

  • Thread starter Thread starter Dirk Schippers
  • Start date Start date
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?
 
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
 
Back
Top