Inheriting forms

  • Thread starter Thread starter Nancy Kafer
  • Start date Start date
N

Nancy Kafer

I would like to use form inheritance in my VB .NET 2003 smart device
application. While researching this I discovered that form inheritance will
not be available until .NET Compact Framework 2.0. Will OpenNetCF allow me
to use form inheritance?

Thanks.

Nancy
 
You can do form inheritance but you will lose designer support for your
forms. A method I use is to use a conditional compile define constant and
your form class like this.

#define BASEFORM //Must be put before your using statements
....
#if BASEFORM
public class form1:BaseForm
#else
public class form1:System.Windows.Forms.Form
#endif

Comment out the #define statement to get designer support and uncomment the
line when debugging. You can also create a Solution Configuration and add
the define constant in there.
 
Back
Top