Solved

Setting anchoring for windows form

Posted on 2009-07-02
6
230 Views
Last Modified: 2012-05-07
Hello,

I have a windows form in VB.net 2008. On this form I have placed two group control - one on the top and the other below that. Each Group control has one graph control. Now when I resize the form vertically i.e. increase height at run-time, I want that both group controls should equally resize so that both graph will also equally resize. What should I set the Anchor property for the Group Controls? The Dock property of the graph control is set to Fill so that it occupies complete space of the group control.

Regards.
MI
0
Comment
Question by:vj_mi
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24763550
Try setting the anchor to "top, bottom".
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24763567
You may find that the groups overlap each other in which case you could use the form_resize event to set the location and size of the controls based on current size of the form.
0
 

Author Comment

by:vj_mi
ID: 24764274
Form_resize event: I cannot use this since at run-time the user will resize the form based on the client's screen resolution. Manaully setting the size/psotion will be very tedeious since the both group controls are within one tab page and there are other controls on other tab page. Any other alternative?

Regards,
MI
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24764369
Did you try using the "top, bottom" as Anchor value?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 24764551
"Any other alternative?"

For keeping things of equal size, use the TableLayoutPanel.  It should just have two rows with a size of percent and 50.  Place your groupbox/graph into each cell with Dock set to fill.
0
 

Author Comment

by:vj_mi
ID: 24764833
>>>"top, bottom" as Anchor value?
I tried that but then the top group control overlaps with the bottom group control.

I will try what Idle_mind suggested and will post the results.

Regards,
MI
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question