But when I try to manually resize the form, the group boxes overlap. How
do
I get the group boxes and contents to stay properly the same while
growing?
Don't anchor both left groupbox to the right side and the right groupbox to
the left side. As this will cause them to overlap when the form resizes. As
each will remain fixed to the opposite side...
Consider:
- anchoring only one of them
- using a TableLayoutPanel (VS 2005)
http://msdn2.microsoft.com/en-us/lib...youtpanel.aspx
Where you anchor each groupbox into a cell of the TableLayoutPanel. Each
cell would have a width of 50%.
-using the Form.Layout event
http://msdn2.microsoft.com/en-us/lib...ol.layout.aspx
Something like (which needs some more work):
Private Sub MainForm_Layout(ByVal sender As Object, ByVal e As
System.Windows.Forms.LayoutEventArgs) Handles Me.Layout
Dim width As Integer = Me.ClientSize.Width \ 2
GroupBox3.Width = (width - Me.GroupBox3.Left -
Me.GroupBox3.Padding.Right)
GroupBox4.Width = (width - Me.GroupBox4.Padding.Horizontal)
GroupBox4.Left = Me.ClientRectangle.Right - GroupBox4.Width -
Me.GroupBox4.Padding.Right
End Sub
--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"Steve" <s.*****@comcast.netwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>I have two group boxes containing labels and textboxes that are next too
each other. I want the group boxes and labels and textboxes to remain
portionally the same as the form is resized.
I've set the group boxes to be anchored left, right, top, and bottom, the
labels to be left, right, top, and the textboxes to be anchored left,
right,top, and bottom.
But when I try to manually resize the form, the group boxes overlap. How
do
I get the group boxes and contents to stay properly the same while
growing?
Thanks