vnarod Posted April 30, 2003 Posted April 30, 2003 I have created a form that inherits from another form. When I try to open it in designer view I get the message: "The designer must create an instance of type "DataEntry.frmMasterForm" but it can't because the type was declared as abstract" What does it mean and what should I do? Quote
*Experts* Nerseus Posted April 30, 2003 *Experts* Posted April 30, 2003 There's a problem in .NET where the Form Designer won't show your inherited form if it's inheriting from an abstract class. For now, you can use "#if DEBUG" (in C#) to change the declaration of the class, as in: #if DEBUG public class MyBaseForm : Form #else public abstract class MyBaseForm : Form #endif -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
vnarod Posted May 1, 2003 Author Posted May 1, 2003 But my class is not declared as abstract (I don't even know what an abstract class is :-( ). It has only MUSTINHERIT option and I cannot turn it off because it has some MustOverride functions. Quote
*Gurus* divil Posted May 1, 2003 *Gurus* Posted May 1, 2003 MustInherit in VB is the same as abstract in C#. The designer has to create an instance of the base class in order to design it, so unfortunately there's no way around this well-known issue except the hack Nerseus suggested. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.