Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SplitterDistance changes in OnFormClosing
Message
From
11/03/2008 00:35:08
 
 
To
10/03/2008 13:50:14
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01300581
Message ID:
01300757
Views:
11
Andrus,

I've not used this SplitContainer control, but I notice that there are several "AutoScale" properties:

AutoScaleDimensions
AutoScaleFactor
AutoScaleMode

Perhaps the setting of one of these properties is changing the form layout slightly and might account for the value of the SplitterDistance changing?

Just a guess.

~~Bonnie




>I have .NET 3.5 WinForms application. This contains form with
>horizontal splitContainer.
>
>I set SplitterDistance to 30 in OnLoad()
>However its value is 41 on OnFormClosing().
>
>I want to obtain original value (30) for restore.
>Any idea why value is changing automatically and how to get real value ?
>
>It is interesting that SplitterDistance increases not by certain number of
>pixels but by some factor.
>
>First increase is from 30 to 41, i.e 11 pixels.
>Seceon increase is frm 41 to a larger number of pixels.
>
>This increasing seems to stop when SplitterDistance reaches to the value
>which is set in Form Designer.
>
>Andrus.
>
>protected override void OnLoad(System.EventArgs e) {
>base.OnLoad(e);
>splitContainer1.SplitterDistance = 30;
>// production code: splitContainer1.SplitterDistance =
>// Settings.SplitterDistance;
>}
>
>protected override void OnFormClosing(FormClosingEventArgs e) {
> // for unknown reason SplitterDistance in 41 here.
> Settings.SplitterDistance = splitContainer1.SplitterDistance;
> base.OnFormClosing(e);
>}
>
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