Re: Inherits broken in VB 2.0?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Nothing is broken.

When you create a user control, VS creates a .Designer file that contains
all the designer generated code. In there it says that the class inherits
from UserControl. So there is your conflict.

If you start off with just a class file, try restarting VS after you change
it to inherit from TabControl. That may help in giving the designer surface.

"Gregory Gadow" <techbear@xxxxxxxx> wrote in message
news:439DE351.31EC73F2@xxxxxxxxxxx
>I am looking to create a custom TabControl in VB using VS 2.0. All of
> the documentation I've found online starts with
>
> Public Class NewTabControl
> Inherits Windows.Forms.TabControl
>
> End Class
>
> But when I try that, I get the following error message:
>
> "Base class 'System.Windows.Forms.TabControl' specified for class
> 'NewTabControl' cannot be different from the base class
> 'System.Windows.Forms.UserControl' of one of its other partial types."
>
> I am starting my new control with a User Control, which seems to be the
> problem; starting with a Class file works fine. But I'm not sure how to
> attach a designer component to a Class, which would allow me to add some
> custom drawn items, such as a "close" button on the tab. Any suggestions
> on how to subclass a standard control?
> --
> Gregory Gadow
>
>


.


Quantcast