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.
 

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

Back
Top