SplitterDistance has changed in OnFormClosing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrus

    SplitterDistance has changed in OnFormClosing

    I have .NET 3.5 WinForms application. This contains form with
    horizontal SplitContainer.

    I set SplitterDistanc e 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 ?

    Andrus.

    protected override void OnLoad(System.E ventArgs e) {
    base.OnLoad(e);
    splitContainer1 .SplitterDistan ce = 30;
    // production code: splitContainer1 .SplitterDistan ce =
    // Settings.Splitt erDistance;
    }

    protected override void OnFormClosing(F ormClosingEvent Args e) {
    // for unknown reason SplitterDistanc e in 41 here.
    Settings.Splitt erDistance = splitContainer1 .SplitterDistan ce;
    base.OnFormClos ing(e);
    }


  • Marra

    #2
    Re: SplitterDistanc e has changed in OnFormClosing

    Windows is a real mess concerning sizes of items in windows.

    I had problems with a window with a menubar and 3 statusbars being
    unable to determine the size of the window left not covered by
    something.

    Comment

    Working...