473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

anchoring

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
Dec 17 '06 #1
3 1678
A little more information
The group boxes overlap in the middle when resizing in either direction.

"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


Dec 17 '06 #2
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

Dec 17 '06 #3
Steve,

This means in my idea that you have only put some anchors on the outer side.

See anchoring as with a ship. If they have no anchors in the middle the
possibilitiy exist that they hit each other when the sea is lowering.

Cor

"Steve" <s.*****@comcast.netschreef in bericht
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


Dec 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lumpierbritches | last post by:
Thank you in advance. Is there a way to anchor a child form say beside the parent form, when that data is needed? Michael
1
by: Brian Conway | last post by:
I have a webform that I have a datagrid on that I want a button at the bottom of the grid to maintain its position with the datagrid, if the grid grows large then button needs to move down with it,...
3
by: Mad Joe | last post by:
Hi! I have a window form that contains 4 elements (2x2) on one panel. Those 4 elements are GroupBoxes of the exact same size, sorted like this: groupBox1 groupBox2 groupBox3 groupBox4 ...
1
by: Ahmed | last post by:
Hello everyone, I am designing an application to work with two screen resolutions, 1024x 768 and 800x600. If the user is using a higher resolution the form should have the same size as 1024x768...
1
by: batista | last post by:
Hello All, I want to anchor my control to the browser window, just like the anchor property in windows forms. Like if i resize my browser window the webgrid should also resize itself. How...
0
by: daveryan78 | last post by:
Hi all, I've been getting a strange problem with anchoring on my forms. I have a form where I put on a tabControl. I set it's anchoring to Top, Bottom, Left, Right. I put a number of tabPages on...
3
by: Greg | last post by:
This works properly: 1. Create a new Form and set it's size to 229, 474. 2. Drag a Panel to the form and set the following properties: Size = 216, 438 Location = 3,1 Anchor = Top, Bottom...
3
by: marfi95 | last post by:
My application consists of basically a treeview on the left side, along with a panel control that takes up the right side. When nodes are clicked on the left, the data on the right side of the...
1
by: sklett | last post by:
I've read several articles/blogs/threads about anchoring/docking child controls in a FlowLayoutPanel. It sounds like it *should* work, but I can't get it to work for the life of me. Jon Skeet: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.