Visual inheritance problem...

  • Thread starter Thread starter Deena
  • Start date Start date
D

Deena

Hi

I create a abstract base class("MyBaseForm") which extends
System.Windows.Forms.Form class. I add buttons,.... . I then extend another
class("MyDerivedForm") from "MyBaseForm". This compiles fine, runs fine but
as soon as I double click - MyDerivedForm - to view the form in the IDE
designer - the IDE designer gives me an error.

Is the a bug? I saw a similar post earlier with no suitable explanation.
This is basically what we are trying to do. Create a base class with
something like this:

namespace MyFormClassLibrary
{
public abstract class MyBaseForm : System.Windows.Forms.Form
{
public MyBaseForm ()
{
}

}
}

Then create another Form and change the superclass from
"System.Windows.Forms.Form " to the "MyPage" class created above:

namespace MyFormClassLibrary
{
public class MyDerivedForm : MyBaseForm
{
public MyDerivedForm()
{
}

}
}
 
Deena,

The problem arises from the fact that the designer needs to be able to
instantiate the base class in order to expose a design surface. Because the
base class is declared as abstract, it can not do this. You will have to
remove the abstract modifier in order to get the designer to work on the
derived forms.

Hope this helps.
 
Back
Top