473,406 Members | 2,371 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,406 software developers and data experts.

Inherited Forms in VB.NET class code does not show 'inherits from...'

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 myform.designer.vb code to show this inheritance.

Also it is unclear to me where to put an overloaded New(...)
definition: in the partial class where you'd type all your other code,
or in the myform.designer.vb code ?

Jan D'Hondt
Database development in .NET
DotNetNuke development

Sep 11 '06 #1
5 2041
The designer file is there to isolate designer generated code from your own
code. Keep your own code inside the myform.vb class...

For the first point, I don't really have anyway to solve this. Perhaps using
a naming convention or a specific folder for Forms ? You could add this as a
comment (or perhaps as a statement but I don't know how the compiler will
react)...
--
Patrice

"jandhondt" <ja*******@jadesoft.bea écrit dans le message de news:
11**********************@h48g2000cwc.googlegroups. com...
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 myform.designer.vb code to show this inheritance.

Also it is unclear to me where to put an overloaded New(...)
definition: in the partial class where you'd type all your other code,
or in the myform.designer.vb code ?

Jan D'Hondt
Database development in .NET
DotNetNuke development

Sep 11 '06 #2
"jandhondt" <ja*******@jadesoft.bewrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
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 myform.designer.vb code to show this inheritance.
I have to agree to with this. I have solved it to an extent as Patrice says
by having a folder structure that reflects inheritance in my solution.
Sep 11 '06 #3
Tnx for the replies.

One big reason for me to switch from the old VB6 to VB.NET was the fact
that all the code for a form was in 1 file and it was all code, which
gave us a lot more control over all the controls in a form compared to
the hidden and unreachable code behind VB6 forms. als great for
applying inheritance and so forth.
Then came VB.2005 and they started to give up the principle of having
everything in one file and moved to more hidden files again. There's a
an american saying : "If it ain't broken, don't fix it". If only they
could appreciate this a bit more at Microsoft.
BTW they did add a lot of good things too, but if only they could keep
their hands off of things that worked.

Robinson schreef:
"jandhondt" <ja*******@jadesoft.bewrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
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 myform.designer.vb code to show this inheritance.

I have to agree to with this. I have solved it to an extent as Patrice says
by having a folder structure that reflects inheritance in my solution.
Sep 11 '06 #4
I gave a try at the other option and it works. You are allowed to duplicate
the inherits statement used in myfile.designer.vb in the myfile.vb file. The
compiler will report an error only if you you don't inherit from the same
class in those two files...

--
Patrice

"Robinson" <it*****************@nowmyinboxisfull.coma écrit dans le
message de news: ee*******************@news.demon.co.uk...
"jandhondt" <ja*******@jadesoft.bewrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>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 myform.designer.vb code to show this inheritance.

I have to agree to with this. I have solved it to an extent as Patrice
says by having a folder structure that reflects inheritance in my
solution.

Sep 11 '06 #5

"jandhondt" <ja*******@jadesoft.bewrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Tnx for the replies.

One big reason for me to switch from the old VB6 to VB.NET was the fact
that all the code for a form was in 1 file and it was all code, which
gave us a lot more control over all the controls in a form compared to
the hidden and unreachable code behind VB6 forms. als great for
applying inheritance and so forth.
Then came VB.2005 and they started to give up the principle of having
everything in one file and moved to more hidden files again. There's a
an american saying : "If it ain't broken, don't fix it". If only they
could appreciate this a bit more at Microsoft.
BTW they did add a lot of good things too, but if only they could keep
their hands off of things that worked.
Ah well to be honest, I mostly prefer not having the code cluttering up my
main source file, especially as it's designer generated. There are certain
important things I would like to see in the user source file though -
inheritance is one of them and also the constructor. However the latter
appears as soon as you write Public Sub New and press enter so it's no
biggie. Overall I think 2005 (and .NET 2.0) are a huge improvement over
what came before.
Sep 11 '06 #6

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

Similar topics

4
by: Mike Cooper | last post by:
There is something about inherited classes I evidently don't know... I wrote the following class: Class Class1 inherits System.Windows.Forms.DataGridTextBoxColumn End Class There is...
11
by: Crirus | last post by:
I need to derive the Windows.Forms.Control 2 times so I design a class like this Public Class BMControl Inherits System.Windows.Forms.UserControl Public Class MapControl Inherits BMControl
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
3
by: John A. Prejean | last post by:
This one has me stumped. I have a base form I am trying to wrap up, but I have one problem. In two functions I am opening a "record detail" form. I would like to keep the code in the base form...
14
by: Graham Blandford | last post by:
Hi there, A quickie I think... If I create a new class that inherits the values of a windows form component class, can there ever be a visual representation of this in the .Net IDE? E.g. if...
4
by: dbuchanan | last post by:
Is the following behavior normal? Both the 'Protected sub' in the inherited form and the 'Private Shadows sub' in the derived form fires. My interpretation of MSDN help on the topic "Shadows"...
3
by: dbuchanan | last post by:
Can inherited code call derived code? If so how. I have identical 'generic' code that I am repeating again and again in several derived form because I don't know how to get inherited code to call...
3
by: Wayne Brantley | last post by:
VS2005 RTM Create a web user control to use as a base class for other web user controls. Now, create a new web user control, change the class it inherits from to your base class and compile....
5
by: D Witherspoon | last post by:
What is happening is that I have a class (ClassA) that inherits a class (ClassB) which inherits System.Net.Mail.MailMessage Project 1 references Project 2, Project 2 references Project 3. ...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.