Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form inheritance
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00826800
Message ID:
00828848
Views:
17
It's quite simple actually. Just create your master form then all you do is inherit from it by using the standard .Net subclassing mechanisms:

using MyApp.Namespace; // or whereever MyTemplateForm is defined.

class MyAppForm : MyTemplateForm
{
...
}

The catch is you have to do this in code - there's no way to have the VS editors automatically subclass - you have to create a regular form then add the subclassing stuff yourself.

Now if you're talking about control inheritance that's a little difference, You will get the controls but have little control over those controls from the parent class...

Markus Egger had an article about this a couple of years back in Code Magazine which pointed out what you could and couldn't do with .Net form and control inheritance.

+++ Rick ---

>Hi,
>
>I've got 20 books on .NET - not one of them covers how to create a base form class that you can inherit PEM's from. I'm in the process of building a C# app - and now that I've got the database and business objects built - the next step is the user interface and I'd really like to take advandage of inheritance in .NET for my forms.
>
>I did come accross this link which was helpful:
>
>http://msdn.microsoft.com/msdnmag/issues/01/06/Basics/default.aspx
>
>... but I was wondering if anyone can point me to more in-depth information on this subject (books, articles ... anything).
>
>Thanks, Al
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform