Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extremely annoying user control issue
Message
General information
Forum:
ASP.NET
Category:
Class design
Title:
Extremely annoying user control issue
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00961050
Message ID:
00961050
Views:
38
This is hard for me to explain without showing you the screen, so, 7 steps to frustration.

1 - Create a new class, inherits from Button.
2 - In the constructor, Font = new Font( "Verdana", 8 );
3 - Add this control to your form by dragging it off the Toolbox.
4 - Compile, run, be happy.
5 - Go change the font, Font = new Font( "Verdana", 6 );
6 - Compile, run, you'll still see size 8 font.
7 - Check out the InitializeComponents, see it there?

Recompiling will not re-run the constructor in such a way as to overwrite the values stored in the form's InitializeComponents. The constructor is run initially to set the properties as intended in the class but apparently never run afterwords.

I know someone else out there has run into this before. Is there anyway to force forms to re-evaluate the settings applied to custom controls once they're added to the form?

I understand the reasoning behind doing it this way. But this means that if I want my core settings to be updated for the control I've now added to the form, I'm going to have to right click -> reset every one of them - or delete the control completely. There's no way everyone does it like that.

Thanks for any help you can provide.
Chris Zangarine
Software Development Engineer
Pipeline Compliance System (PCS)
American Innovations
Next
Reply
Map
View

Click here to load this message in the networking platform