473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Inherits broken in VB 2.0?

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
Dec 12 '05 #1
3 3228
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" <te******@serv.net> wrote in message
news:43***************@serv.net...
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

Dec 12 '05 #2
In the solution provider click on the "Show All files button"
then in the <ClassName>.Designer.vb file change the
Inherits Windows.Forms.UserControl
to
Inherits Windows.Forms.TabControl

Regards
Neal

"Gregory Gadow" <te******@serv.net> wrote in message
news:43***************@serv.net...
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

Dec 12 '05 #3
"Gregory Gadow" <te******@serv.net> schrieb:
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."
Select the "Show all files" button in the solution explorer. You'll see
that the file "NewTabControl.vb" has a companion file named
"NewTabControl.Designer.vb". In order to make your code compile, change the
'Inherits' line in this file too.
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?


IIRC there is no way to edit a tabcontrol in its own designer the way this
is supported for user controls.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frank de Bot | last post by:
Hi, occasionaly I find in my apache logs that fastcgi had a broken pipe error with php running as fastcgi. the logs are like this: -- > (32)Broken pipe: > FastCGI: comm with server...
1
by: shine | last post by:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="shine.WebForm1" %> what does Inherits means in this tag, what is the use of it plz explain me regards...
4
by: Ben R. | last post by:
Between ClassName and Inherits, which attribute is set to specify the class that a page uses? I would think that would be inherits. Further, the description for ClassName is: Specifies the class...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
1
by: Roberto Bindini | last post by:
Hi with visual studio 2005 beta 2 i have created two form: frm1 (Inherits System.Web.UI.Page) frm2 (Inherits frm1) but in the line code : Inherits frm1 vs send error: type frm1 is not defined
10
by: Tony Abate | last post by:
I am working on an ASP.NET app that is going well except for one thing. I build my application and then move the .aspx file to a different directory. I can point the Codebehind property back to the...
2
by: Don | last post by:
1. Say I have three classes: A, B and C. 2. Class A can only be inherited, and B inherits it. C does not inherit anything. 3. I have a function that can have an object passed to it. Either B...
5
by: jandhondt | last post by:
In VS2005 with VB.NET when a form or usercontrol is inherited: it is terribly annoying that the code view shows as Public Class statement without the inherits statement. You have to go to the...
2
by: Morgan Cheng | last post by:
In .Net 2.0, Generics are introduced. I found that IEnumerable<T> inherites from IEnumerable. This makes implementation of IEnumerable<Thas to have two GetEnumerator methods defined( one for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.