Visual inheritance and .NET IDE

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()
{
}

}
}

Is there a fix for the IDE?
 
J

José Araujo

I ran into that problem months ago...

I got to the conclusion that you couldn't do that because of the IDE...

I wonder how Microsoft left that problem happen...

José.
 
J

José Araujo

How is that important?

And i think that is something pretty common...

BTW: have you accomplished using abstract classes for forms + IDE before?

José.
 
S

Sahil Malik

It is important because .NET IDE runs the control's code, and if it
encounters "parent", parent doesn't exist and it gets confused. Not only
that, if you have a custom paint event that occurs on some UI feedback, then
that might crash the IDE too (some stackoverflow exception cuz it goes in a
infinite paint loop .. dunnow why .. details aren't documetned/published no
way to find out either for sure).

Abstract base class - Yes I have.

--
- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/
 

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