Solved

Setting anchoring for windows form

Posted on 2009-07-02
6
233 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 83

Expert Comment

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

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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