We help IT Professionals succeed at work.

Setting anchoring for windows form

vj_mi
vj_mi asked
on
Medium Priority
256 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
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Try setting the anchor to "top, bottom".
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
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.

Author

Commented:
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
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Did you try using the "top, bottom" as Anchor value?
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
>>>"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
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.