|
-
Jun 28th, 2004, 02:00 PM
#1
Thread Starter
Hyperactive Member
Inheritance ..
VB.NET does not support Multiple Inheritance. The problem here is .. you can write classes and manage it with Deep Inheritance.
So Car Class can inherit Auto and Parts can inherit Car to get to Auto.
But how can you manage this in Windows Forms ? They are apparently nothing but classes and they are always inheriting Inherits System.Windows.Forms.Form ... so how do you implement deep inheritance here ?
-
Jun 28th, 2004, 02:36 PM
#2
Frenzied Member
What are you trying to do with Forms? I mean, you can create a custom form that inheritsa from a regular form, and then inherit from that. They are, as you have said, just classes.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jun 28th, 2004, 02:53 PM
#3
Let's get it straight shall we?
VB does not support Multiple-Base inheritance but it does support Multiple-Level Inheritance (deep).
I don't live here any more.
-
Jun 28th, 2004, 07:04 PM
#4
PowerPoster
Hi wossname,
Ref. your new signature. You mean that what comes out of your mouth is the same as comes out of my a.......?
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.
-
Jun 29th, 2004, 12:36 AM
#5
Re: Inheritance ..
Originally posted by spoiledkid
But how can you manage this in Windows Forms ? They are apparently nothing but classes and they are always inheriting Inherits System.Windows.Forms.Form ... so how do you implement deep inheritance here ?
Multiple inheritance would be done with your own custom classes, as need-be. Like the example you mentioned.
With WIndows Forms though, you can try out visual inheritance. You start off with a basic form, Form1, which inherits Sys.win.forms. Then let form2 inherit form1, and add a few controls to it.
Then let form3 inherit form2, and add a few more elements.
Finally, try working with it and you'll get so confused that you'll run out into the forest screaming in frustration and start bashing your head against a tree. 
Edit: D'oh! I read it wrong!
*/me runs into forest screaming, bashes head against tree in frustration*
Last edited by mendhak; Jun 29th, 2004 at 07:17 AM.
-
Jun 29th, 2004, 06:16 AM
#6
Hyperactive Member
The bottom line here is this:
VB.NET does not support Multiple Inheritance.
The fact that it supports inheritance at all is a long awaited gift. I've been programming with VB since 1993, and I can assure you that any support of inheritance at all is a god send. Having said that, in order to support multiple inheritance, you will probably need to switch languages for that kind of support. The nice thing about .NET is that you can mix languages. So if you need to write the bulk of your code in VB but end up needing a Class or two written in a language that supports multiple inheritance then I suggest writting those classes/forms in C#. C# is not a difficult language to learn and should solve your problem.
-
Jun 29th, 2004, 06:21 AM
#7
Thread Starter
Hyperactive Member
Originally posted by CyberHawke
The bottom line here is this:
The fact that it supports inheritance at all is a long awaited gift. I've been programming with VB since 1993, and I can assure you that any support of inheritance at all is a god send. Having said that, in order to support multiple inheritance, you will probably need to switch languages for that kind of support. The nice thing about .NET is that you can mix languages. So if you need to write the bulk of your code in VB but end up needing a Class or two written in a language that supports multiple inheritance then I suggest writting those classes/forms in C#. C# is not a difficult language to learn and should solve your problem.
C# does not support multiple inheritance either ...
-
Jun 29th, 2004, 06:35 AM
#8
You might want to think about interfaces instead, You can use a class to implement multiple interfaces.
This may or may not be plausible for your project though.
I don't live here any more.
-
Jun 29th, 2004, 06:41 AM
#9
Hyperactive Member
I stand corrected, I knew that I had done some work with mutiple interfaces and I guess I confused it. The work I did worked with several interfaces that I had created and then implemented those interfaces in a single class instance. Sorry if I confused anyone.
-
Jun 29th, 2004, 07:07 AM
#10
Thread Starter
Hyperactive Member
Originally posted by wossname
This may or may not be plausible for your project though.
well, there you go .. tx anyway.
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
|