Visual inheritance & DESIGNER constant: Where is it?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Strider (Strider_at_discussions.microsoft.com)
Date: 10/14/04


Date: Thu, 14 Oct 2004 03:27:03 -0700

Hello all!

I have developed a class that inherits from System.Windows.Forms.Form which
enhances the base type's keyboard handling.

This new type (EnhancedForm) is to be inherited from all the forms in my
project.
I am aware that visual inheritance is not supported in the CF, so I tried to
fool the designer by declaring my subclasses like this:

#if DESIGN
public class ASubclassedForm: System.Windows.Forms.Form
#else
public class ASubclassedForm: MyCompany.Windows.Forms.EnhancedForm
#
{
   ...

Visual studio .NET 2003 is supposed to automatically define a constant named
"DESIGN" in design time. I've seen it used in OpenNetCF and read articles
about it, but in my case the code under the #if DESIGN block is allways
grayed out in the designer, unless I define the constant myself.

Any clues?

Thanks in advance.



Relevant Pages

  • Re: Problems with inheritance in vb.net
    ... you can not design a form that inherits from a MustInherit ... describe happens when the modifier is set to Private. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Problems with inheritance in vb.net
    ... you can not design a form that inherits from a MustInherit ... describe happens when the modifier is set to Private. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Problems with inheritance in vb.net
    ... you can not design a form that inherits from a MustInherit ... describe happens when the modifier is set to Private. ...
    (microsoft.public.dotnet.general)
  • Re: Making a custom form and inheriting it
    ... #if DESIGN ... Windows Embedded MVP ... "Tomer" wrote in message ... > I've made a new class that inherits from a form, ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: Visual inheritance & DESIGNER constant: Where is it?
    ... "Strider" wrote: ... > I have developed a class that inherits from System.Windows.Forms.Form which ... > public class ASubclassedForm: MyCompany.Windows.Forms.EnhancedForm ... > grayed out in the designer, unless I define the constant myself. ...
    (microsoft.public.dotnet.framework.compactframework)