vb.net usercontrol inheritance designer

M

marfi95

I am trying to setup a usercontrol as a base class, so that I can
derive my usercontrols from it.

the base is pretty simple:

Imports System.Xml
Public Class usrBase
Inherits System.Windows.Forms.UserControl

Public Overridable Sub MethodA()
End Sub
End Class

'derived classes
Public Class usrMyControl
Inherits usrBase
....
....
End Class

The issue is that I can't see my form usrMyControl in the designer
anymore and gives an error that says " The designer must create an
instance of type 'usrBase' but it cannot because the type is declared
as abstract.".

However, I thought the class was only consider "abstract" when the
MustInherit/MustOverride clauses are used, which I'm not using them
here. Why does it think it is still abstract ?

What am I doing wrong ? Is there another way to do this ?

Mark
 
M

Marina Levit [MVP]

If this is literally the code you have, then I would attribute it to a
designer bug.
 
T

Tom Shelton

["Followup-To:" header set to microsoft.public.dotnet.languages.vb.]
I am trying to setup a usercontrol as a base class, so that I can
derive my usercontrols from it.

the base is pretty simple:

Imports System.Xml
Public Class usrBase
Inherits System.Windows.Forms.UserControl

Public Overridable Sub MethodA()
End Sub
End Class

'derived classes
Public Class usrMyControl
Inherits usrBase
...
...
End Class

Is this your exact code? Something ins't right there....
 

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