Subclassing Forms

  • Thread starter Thread starter Tommy Martin
  • Start date Start date
T

Tommy Martin

Is it possible to create a form with standard controls on it and subclass it
like you can do for a normal windows desktop app?

Thanks...
Tommy
 
The designer doesn't support visual inheritance. You can make the derived
class just fine - the designer just can't display it.
 
Because I have a sort of large ppc app to write. It has about 20 to 25 forms
and each one needs the same menu on it. That way I can create 1 with the
menu functionality I want and use it as a base for the rest of my forms.

I know I can write a class to add the menu programatically but I thought
this would be a better solution if possible.

Tommy
 
Hi Tommy,

I aggree... Very useful for common form properties...
Add another Build config into your solution and change
the configuration when you want to use Design View and
change back when you want to compile.


#if DESIGN
public class FrmAbout : System.Windows.Forms.Form
#else
public class FrmAbout :
CompanyName.Framework.Controls.BaseForm
#endif
 
Back
Top