VS.NET form designer cannot show a derived form of an abstract cla

G

Guest

Hi,

I created an abstract base class with some features in it, something like:

public abstract class MyBaseClass : Form
{
// constructor, destructor, etc...
}

And I created a derived class from it, like:

public class MyDerivedClass : MyBaseClass
{
// constructor, destructor, etc...
}

When I try to open the derived class in the VS.NET form designer, it shows
an error stating that VS.NET cannot open an abstract class. But if I try to
open the base class, VS.NET opens it without any problem.

Is this a VS.NET issue? Has anybody seen this behavior before? Is there a
workaround for this?

Thanks,
Edmundo
 
H

Herfried K. Wagner [MVP]

Edmundo said:
I created an abstract base class with some features in it,
something like:

public abstract class MyBaseClass : Form
{
// constructor, destructor, etc...
}

And I created a derived class from it, like:

public class MyDerivedClass : MyBaseClass
{
// constructor, destructor, etc...
}

When I try to open the derived class in the VS.NET form
designer, it shows an error stating that VS.NET cannot
open an abstract class. But if I try to open the base class,
VS.NET opens it without any problem.

Is this a VS.NET issue? Has anybody seen this behavior
before? Is there a workaround for this?

The designer needs to instantiate the form's base class. That's why the
abstract class can be opened in the designer, but not the class derived from
the abstract class.
 
G

Guest

Until now, there is no way for VS.NET to show the derived class of an
abstract class in the designer without removing the 'abstract' property?

If VS has to instantiate the base class when it is an abstract one... Is
Microsoft working to fix this? Or this option will never be available?

Thanks,
 

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

Top