
repost: How to... With inherited control
(reposted because of the newsgroups mess)
I'm building a test app in vb.net.
Due to the lack of rebar support, I decided to temporarily do it with an
inherited panel, one that draws the rebar look.
So I created a panel using the IDE, all fine.
Next I created a class to inherit the panel, doing this:
Public Class PanelEx
Inherits Panel
Protected Overrides Sub OnPaint(ByVal e As
System.WinForms.PaintEventArgs)
MyBase.OnPaint(e)
......
'Boring Drawing Stuff
......
End Sub
End Class
Then I replaced the System.Winforms.Panel with PanelEx on the form code. I
run the project, all works as expected, but if I reopen the form in design
mode, I get:
"An error occured while loading the document. Fix the error, and then try to
load the document again. The error message follows:
Could not create the component 'Panel1' because the type 'PanelEx' could not
be loaded. Please make sure that the assembly that contains the type is
referenced. If this type is a part of your development project, make sure
that the project has been successfully built."
Any hints as to what I'm doing wrong? Is this a bug in Beta1?
Best Regards,
Miguel Santos