|
-
Mar 5th, 2004, 11:36 AM
#1
Thread Starter
PowerPoster
Inherited Forms
Hi,
I am probably missing something simple but could someone assist with the following, please?
I have a form fclsAction which contains all the controls and code common to several different actions in my project.
fclsEnterResults is a form which inherits from fclsAction.
When I view fclsEnterResults in design view, I can see all of the controls from fclsAction. However, none of the code I wrote in fclsAction appears in the code window for fclsEnterResults.
But, the programme does work (to some extent) when I create an instance of fclsEnterResults.
Does this mean that although the GUI is inherited the underlying code is not?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 5th, 2004, 01:40 PM
#2
Sleep mode
If I'm not wrong , then you're using visual inheritance . If this is the case , then this should answer your questions : http://visualbasic.about.com/library.../aa081603a.htm
-
Mar 5th, 2004, 06:17 PM
#3
Thread Starter
PowerPoster
Hi Pirate,
"If I'm not wrong , then you're using visual inheritance "
What is the difference between "Visual Inheritance" and any other type of Inheritance?
". If this is the case , then this should answer your questions : http://visualbasic.about.com/librar...y/aa081603a.htm"
Looks like a good site and I will use it in future BUT it's article on Inheritance does not deal with any of the points I raised.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 5th, 2004, 08:55 PM
#4
I'm guessing but looking at how the forms operate I'd say that the inherited code simply isn't displayed. It all still works though, you just have to modify the inherited code from the base.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
Mar 5th, 2004, 08:57 PM
#5
To prove it, place a button on the form and insert this code in it:
make a form inherit this and click the button, if the code wasn't inherited, the messagebox wouldn't display, they fact that it does means that the code is inherited but not displayed in the code window.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
Mar 6th, 2004, 02:41 AM
#6
Sleep mode
-
Mar 6th, 2004, 03:27 AM
#7
Thread Starter
PowerPoster
Hi Pirate,
"About visual inheritance : http://visualbasic.about.com/librar...y/aa081603a.htm"
This is the same reference as you gave in your previous response. I repeat, it does not mention the points I raised.
Hi Ideas Man,
But when you consider that all forms inherit from System.Windows.Forms.Form and the code window of the designed form shows a massive amount of coding - although the coding it shows seems to be related only to the instancing and setting properties of objects, with the exception of the Constructor Sub (which does contain a call to "InitialiseComponent" - a sub which cannot be seen anywhere).
Looks like you are correct, but you would have thought that this point should have been covered in MSDN or all other literature which deals with Inheritance. I can't find any such coverage.
Still, if you are getting the same effect then it does mean that there is nothing wrong with my copy of VisualStudio.Net!!!
Many thanks.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 6th, 2004, 03:30 AM
#8
Yeah i noticed that too, took me ages to find a very simple way of changing forms. Why has everything that was once simple, has been considered simple in .NET or just not documented?
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
-
Mar 6th, 2004, 03:36 AM
#9
Thread Starter
PowerPoster
Hi Ideas Man,
"Why has everything that was once simple, has been considered simple in .NET or just not documented?"
That's life! Have you looked under the bonnet of a new car recently??? The price of progress is that mere mortals understand less and less of what is happening.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 6th, 2004, 03:40 AM
#10
mm, sad but true. But one thing i have noticed, is that Windows XP and Server 2003's help is better than ever, that Help and Support Center breaks this trend, pitty it VS.NET help isn't as efficient as it is, IMHO.
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|