L
Lance
I get an exception when attempting to open a form in
design mode if the form inherits from a form that is
declared as MustInherit. For example, if I have:
Public MustInherit Class TestFormBase
Inherits Windows.Forms.Form
'...Normal Windows Form Designer generated code here
Public MustOverride Function GetValue() As Integer
End Class
Public Class TestForm
Inherits TestFormBase
'...Normal Windows Form Designer generated code here
Public Overrides Function GetValue() As Integer
Return 100
End Function
End Class
Then I get the following exception when I attempt to open
TestForm in design mode:
The designer must create an instance of
type 'TestFormBase' but it cannot because the type is
declared as abstract.
Curiously, I do not get an exception if I open
TestFormBase in the designer.
Is there any way to avoid this exception?
Thanks,
Lance
design mode if the form inherits from a form that is
declared as MustInherit. For example, if I have:
Public MustInherit Class TestFormBase
Inherits Windows.Forms.Form
'...Normal Windows Form Designer generated code here
Public MustOverride Function GetValue() As Integer
End Class
Public Class TestForm
Inherits TestFormBase
'...Normal Windows Form Designer generated code here
Public Overrides Function GetValue() As Integer
Return 100
End Function
End Class
Then I get the following exception when I attempt to open
TestForm in design mode:
The designer must create an instance of
type 'TestFormBase' but it cannot because the type is
declared as abstract.
Curiously, I do not get an exception if I open
TestFormBase in the designer.
Is there any way to avoid this exception?
Thanks,
Lance