Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem subclassing
Message
From
29/09/2003 16:12:08
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00833222
Message ID:
00833297
Views:
25
Kevin,

As Rick said, it *does* happen on other things besides forms. I've specifically had it happen to me repeatedly with the ButtonSize in ToolBars. I've found though that if I go into the auto-generated code and comment out the ButtonSize property, that usually seems to keep it from messing up again after that. You might see if that works for you with the start position. No guarantees ... ;)

~~Bonnie


>I had posted a message similar to this one a few months ago, but I think I can describe my problem a little more clearly now.
>
>I'm having a problem with default values in a base class when I use the class on a form. For example...
>
>1) I create a form class in WinForms called MyBaseFrm
>2) In MyBaseFrm, I set the start position to 20, 20
>3) I create a test form called MyTest, and use MyBaseFrm as the base class for the form. At first, it inherits the start position of 20,20
>
>4) However, if I change other attributes of the form [text/caption, or any other property], WinForms winds up 'writing out' the start position as part of the generated code.
>
>So if I go back to my Base form and change the start position to something else [say, 50, 50]...the form MyTest doesn't pick up the change...because there was code written out to set the start position as 20,20. The only way I can get the MyTest form to use 50, 50 is to highlight the postion property, right-click, and take RESET. Which certainly doesn't seem very efficient.
>
>I've had similar problems with other controls [I create a custom textbox class, and then change the properties, but they don't get reflected in places where I instantiate the class].
>
>Maybe I am royally missing something...and I hate comparing .NET to VFP...but it just seems that things like subclassing and inheritance seem to work more cleanly and intuitively than .NET. But again, I may be being really stupid about something and could use some advice in the right direction.
>
>Thanks,
>Kevin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform