inheritance

  • Thread starter Thread starter michael
  • Start date Start date
M

michael

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?
 
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... 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?<
 
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 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
what can i do?<


.
 
Back
Top