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);
>}
>