Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

SplitterDistance has changed in OnFormClosing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrus - 09 Mar 2008 21:15 GMT
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 ?

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);
}
Marra - 09 Mar 2008 23:57 GMT
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.
Andrus - 10 Mar 2008 10:06 GMT
Marra,

> 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.

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.
Any idea how to fix this ?

Andrus.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.