Well not entirely, no
Let me explain the situation in more detail. I have a requirement in my
program for two dialogs that are essentially the same layout, and only
differ by the a couple of buttons and some underlying code.
I would therefore like to have a base class with the common design and
common code and then have two child classes inherit this base class, so I
can add the extra buttons and code specific to the child class.
Let's assume I have defined a base class called OrderForm, I then create
another class as follows:
Public Class SaleForm
Inherits OrderForm
End Class
If I then try to view the Form designer for SaleForm I get errors something
along these lines in the design view window, so I can't add any controls to
it at design time.
------------------------------------------------
One or more errors encountered while loading the designer.The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes. Clicking on each error will take you to the
line of code that caused it.
Object reference not set to an instance of an object.
Hide
Edit
at System.ComponentModel.Design.DesignSurface.get_View()
at
Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.CreateWindowPane(DesignSurface
surface)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.CreateWindowPane(DesignSurface
surface)
at
Microsoft.VisualStudio.Design.VSDesignSurface.Microsoft.VisualStudio.Designer.Interfaces.IVSMDDesigner.get_View()
----------------------------------------------
This doesn't always happen, sometimes the child class will display in the
form designer as expected, then next time I load the project, I get the
above error or something similar.
The program compiles and runs without any problems, and I suppose I could
add the extra controls at runtime, but it would be nice to do it graphically
at design time.
Am I missing something obvious that is causing this?
Thanks,
Martin.