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 / Windows Forms / WinForm Controls / December 2006

Tip: Looking for answers? Try searching our database.

VS2005 SpliterContainer Control ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JerryWEC - 14 Dec 2006 15:55 GMT
Hi all!

I have a splitter container control I'm trying to get set for a minium height on panel2..  I'm doing the following code in the SplitterMoved event...

Private Sub scAppDiv_SplitterMoved(ByVal sender As Object, ByVal e As System.Windows.Forms.SplitterEventArgs) Handles scAppDiv.SplitterMoved
   Try 'Note: Changing the SplitterDistance from the Top will cause this event to occur again!
        ' If this event constantly changes it will cause an overflow condition.
       Dim MinPanel2Height As Integer = 40
       If Me.scAppDiv.SplitterDistance > (Me.scAppDiv.Height - MinPanel2Height) Then
           Me.scAppDiv.SplitterDistance = (Me.scAppDiv.Height - MinPanel2Height)
       End If
   Catch ex As Exception
       ParentLogging.ProcessException(ex)
   End Try
End Sub

This is causing a System.StackOverflowException when I resize my form to a minium value. It does not seem happen if I never move the splitter, but if I move the splitter between panel1 and panel2 then I get this StackOverflowException.

Is there any way to safely set a minium size for panel1 and panel2 of the SplitterContainer control?

Thanks! JerryM
JerryWEC - 14 Dec 2006 16:06 GMT
Sorry, this was so easy I just had to look!

There is a Panel1MinSize and Panel2MinSize properties that you can set to 40 or 50 or whatever.  This does my minium size and does not cause any exceptions.

JerryM

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.