Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does Visual Inheritance work in .Net?
Message
From
20/06/2007 14:43:12
 
 
To
20/06/2007 12:42:50
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01234107
Message ID:
01234558
Views:
11
...because now you have to overwrite .NET font properties and write some additional code in order to ensure proper inheritance. Or am I just completely missing something here?

Just so that everyone is clear....the reason for this, is because the Winform designer generates code for the control in the form's InitializeComponent, when you drop the control on the form and start setting other properties for the control (like name, etc.).

The simple way to prevent this is to override the Font property and use the base keyword, in your subclass. That's IT...that's all you have to do, it's simply in your subclass class, and then inheritance will work cleanly. Very very small price to pay. Most .NET people just address it and move on to more important things.


Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform