Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SplitterDistance changes in OnFormClosing
Message
De
11/03/2008 00:35:08
 
 
À
10/03/2008 13:50:14
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01300581
Message ID:
01300757
Vues:
12
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform