473,508 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

inheritance

how to make a class inherit from more that one other
class or namespace

ex:
public class MyClass
{ //some code here
}

public class MyForm : System.Windows.Forms.Form
{
....
}

I want the form to inherit also from the class MyClass.

what can i do?
Nov 15 '05 #1
5 2355
No multiple class inheritanace on C#; just interfaces.

You need to have them inherit from one after the other if you want that.

C# 101

Did you ever read it?
"michael" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
how to make a class inherit from more that one other
class or namespace

ex:
public class MyClass
{ //some code here
}

public class MyForm : System.Windows.Forms.Form
{
...
}

I want the form to inherit also from the class MyClass.

what can i do?

Nov 15 '05 #2
no what is that?
Nov 15 '05 #3
C# 101 is very very basic C#

No multiple class inheritance.

<an*******@discussions.microsoft.com> wrote in message
news:e5****************************@phx.gbl...
no what is that?

Nov 15 '05 #4
Michael... this may help:

http://www.geocities.com/jeff_louie/OOP/oop9.htm
Note: Simulating Multiple Inheritance

If you really feel the need for multiple inheritance of implementation,
consider using containment and delegation to simulate multiple
inheritance. In this idiom, you release a skeletal implementation and a
matching* interface. The user of your skeleton class and interface
creates
a concrete implementation of the skeleton class. The user then wraps the
concrete object, implements the interface and forwards (delegates) all
interface calls to the contained object.

Regards,
Jeff
I want the form to inherit also from the class MyClass.

what can i do?<

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #5
fvdbg
-----Original Message-----
Michael... this may help:

http://www.geocities.com/jeff_louie/OOP/oop9.htm
Note: Simulating Multiple Inheritance

If you really feel the need for multiple inheritance of implementation,consider using containment and delegation to simulate multipleinheritance. In this idiom, you release a skeletal implementation and amatching interface. The user of your skeleton class and interfacecreates
a concrete implementation of the skeleton class. The user then wraps theconcrete object, implements the interface and forwards (delegates) allinterface calls to the contained object.

Regards,
Jeff
I want the form to inherit also from the class MyClass.what can i do?<

*** Sent via Developersdex http://www.developersdex.com

***Don't just participate in USENET...get rewarded for it!
.

Nov 15 '05 #6

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

Similar topics

2
4359
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
2
4321
by: Graham Banks | last post by:
Does using multiple inheritance introduce any more performance overhead than single inheritance?
4
2881
by: JKop | last post by:
I'm starting to think that whenever you derive one class from another, that you should use virtual inheritance *all* the time, unless you have an explicit reason not to. I'm even thinking that...
5
2166
by: Morgan Cheng | last post by:
It seems no pattern defined by GoF takes advantage of multiple inheritance. I am wondering if there is a situation where multiple inheritance is a necessary solution. When coding in C++, should...
10
2633
by: davidrubin | last post by:
Structural inheritance (inheriting implementation) is equivalent to composition in that a particular method must either call 'Base::foo' or invoke 'base.foo'. Apparantly, The Literature tells us to...
14
12878
by: Steve Jorgensen | last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling a particular case of implementation inheritance that would be easy and obvious in a fully OOP language, but is not at...
22
23317
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
45
6309
by: Ben Blank | last post by:
I'm writing a family of classes which all inherit most of their methods and code (including constructors) from a single base class. When attempting to instance one of the derived classes using...
60
4867
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
6
3798
by: Bart Simpson | last post by:
I remember reading on parashift recently, that "Composition is for code reuse, inheritance is for flexibility" see (http://www.parashift.com/c++-faq-lite/smalltalk.html#faq-30.4) This confused...
0
7223
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
7321
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,...
1
7034
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
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
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...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.