Solved

Setting anchoring for windows form

Posted on 2009-07-02
6
203 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
Comment Utility
Try setting the anchor to "top, bottom".
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 83

Expert Comment

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

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
"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
Comment Utility
>>>"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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now