• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Could someone help with docking and anchoring issue.

Label1
Datagrid1



Label2
Datagrid2



*****This is the layout on my form. I need to be able to resize the form, and both datagrids resize. But I can't figure out my settings in order for datagrid1 to not overlap with Label2. I am using Docking and Anchor properies. Can anyone help?
0
Gary2397
Asked:
Gary2397
  • 3
  • 2
1 Solution
 
Brian CroweCommented:
what version are you using? 2003 or 2005?
0
 
Brian CroweCommented:
If you are using VS2003 then I'm afraid you can't do this with just anchor and docking properties.  You could have one or the other of the datagrids resizing but not both.  The solution is to place each label/datagrid pair in its own panel or group and then anchor the label (top/left) and the anchor the datagrid (top/left/right/bottom) within the panel/group.  You would then need to handle the form.resize event to insure that the form is split evenly between the two groups and move the lower group down to retain the padding between the two.

If you are using VS2005 then I believe you can use the tablelayout control but I dont' have much personal experience with it.
0
 
Gary2397Author Commented:
VS 2003 -- Let me attempt to try your suggestions.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Bob LearnedCommented:
You could do it with anchors:

Label1 -- Top, Left
Datagrid1 -- Top, Bottom, Left, Right

Label2 -- Bottom, Left
Datagrid2 -- Bottom, Left, Right

Bob
0
 
Brian CroweCommented:
That wouldn't resize Datagrid2's height
0
 
Bob LearnedCommented:
True ;)

Bob
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now