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?
Gary2397Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian CroweDatabase AdministratorCommented:
what version are you using? 2003 or 2005?
0
Brian CroweDatabase AdministratorCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gary2397Author Commented:
VS 2003 -- Let me attempt to try your suggestions.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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 CroweDatabase AdministratorCommented:
That wouldn't resize Datagrid2's height
0
Bob LearnedCommented:
True ;)

Bob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.