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# / September 2007

Tip: Looking for answers? Try searching our database.

SplitContainer Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aaron - 10 Jul 2007 15:00 GMT
Is there a fix for the bug in the SplitContainer control?

When the designer generates the code for a SplitContainer, it does so in
this order:

this.mainSplitContainer.Panel2MinSize = 290;
this.mainSplitContainer.Size = new System.Drawing.Size(587, 315);
this.mainSplitContainer.SplitterDistance = 290;

The first line of this sequence throws an InvalidOperationException with a
message of: "SplitterDistance must be between Panel1MinSize and Width -
Panel2MinSize."

If you move the initialization of the Size property above the initilization
of the Panel2MinSize property, the code works fine.  I have found a few other
places that discuss this error including a feedback post from when Visual
Studio was in Beta, but apparantely, this one slipped through the cracks.  

Has Microsoft released any kind of fix or workaround for this yet?
ModelBuilder - 11 Jul 2007 03:14 GMT
I haven't seen this happen with VS 2005 SP1 or the beta 1 of ORCAS.  What VS
version are you using?

> Is there a fix for the bug in the SplitContainer control?
>
[quoted text clipped - 15 lines]
>
> Has Microsoft released any kind of fix or workaround for this yet?
Aaron - 11 Jul 2007 15:24 GMT
I'm am using Microsoft Visual Studio 2005 version 8.0.50727.762
(SP.050727-7600)
on Windows XP Professional Version 2002 Service Pack 2.  It utilizes .NET
Framework Version 2.0.50727.

Need any other information?

> I haven't seen this happen with VS 2005 SP1 or the beta 1 of ORCAS.  What VS
> version are you using?
[quoted text clipped - 18 lines]
> >
> > Has Microsoft released any kind of fix or workaround for this yet?
ModelBuilder - 11 Jul 2007 17:38 GMT
OK, I just got it to happen.  It appears the constraints of the minimum size
of the panels and the splitter distance need to consider the width arround
them.  Once the control is messed up in this way, it stays messed up even if
you fix the constraints.  I had to delete the split container then add a new
one to get things working.  

Sorry to send you astray Aaron.

> I'm am using Microsoft Visual Studio 2005 version 8.0.50727.762
> (SP.050727-7600)
[quoted text clipped - 25 lines]
> > >
> > > Has Microsoft released any kind of fix or workaround for this yet?
Aaron - 11 Sep 2007 14:50 GMT
Sorry it has taken me so long to respond.  I was just now to the point where
I could try deleting and re-adding the split container.  I did that, but it
still has the problem.  Everytime the code generator re-generates the
InitializeComponent method, it always puts the Size declaration after the
MinSize property.  Is there a fix for this anywhere?

> OK, I just got it to happen.  It appears the constraints of the minimum size
> of the panels and the splitter distance need to consider the width arround
[quoted text clipped - 33 lines]
> > > >
> > > > Has Microsoft released any kind of fix or workaround for this yet?

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.