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