Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wanted tricks for multiple area resizing 1

Status
Not open for further replies.

MrDataGuy

Programmer
Oct 18, 2010
231
US
I am about to create for a client a form that will have somewhere around 6-9 (Design still not set) “areas” (Panels) in it, where there will be a graph in each ( via foxgraph see ). This will be a dashboard page for my clients. Now I want the form to be resizeable (easy enough) but the issue is that I want each of the graphs to resize proportionally.

(For those who may not know if one anchors each of the areas as the form grows the areas start to overlap. One can lock the size of some of the areas and let the other areas shrink and grow but that is only a partial fix.)

Example: If there are 9 areas, and let us assume that they are laid out in a tick-tack-toe formation. I need each to resize by 1/3 of the whole form change. And of course not only resize but adjust the top and left as needed. Now I have done this in the past my writing code to do the needed calcs and roll my own anchoring routines, but before I do it again for this project I was wondering if there is some standard solution out there that I am missing. Any suggestions?


Lion Crest Software Services
Anthony L. Testi
President
 
you can do this with anchoring, as there is absolute and relative anchring. In a 3x3 tic tac toe layout the inner area is anchored relative to each side, areas at the margin are anchored absoulte to the margin side and relative to the inner side, works absolutely fawless.

Double click on the anchor property in the property window and use the anchor wizard to easily put together the needed anchors to each side of the areas.

Bye, Olaf.
 
Hmm ok, I have tried to use absolute and relative anchoring in the past with limited success. I am sure it is because I did not fully understand/appreciate the use of them. So now that you have confirmed that they will work as I want I will invest sometime into making sure I more fully understand when and how to use them. . I will post again if I get completely confused, but for now it is better if I struggle for a little, I tend to retain knowledge better that way.

Thanks for the heads up, and pointing me in the right direction, the perfect answer to my question.


Lion Crest Software Services
Anthony L. Testi
President
 
Olaf,
Thank you again that works perfect! I like to learn at least one new trick a day and this qualifies. So much easier then the hand coding that I have written in the past. (I do give myself a pat for being smart enough to ask for help thou <wink> )


Lion Crest Software Services
Anthony L. Testi
President
 
Hi Anthony,

glad you got it working. You're right thought, there surely are more complex situations where anchoring will not yield the perfect solution.

One more thing to know about anchoring: If you use containers on the form, the absolute/relative anchoring of controls within such a container will not be toward form edges, but container edges. With this you can actually also make more things to resize nicely, but when reorganising controls within containers may need to adapt code references, which might make this approach less appropriate.

Bye, Olaf.
 
reorganising controls within containers may need to adapt code references, which might make this approach less appropriate"

Yes that is what I am finding out

Lion Crest Software Services
Anthony L. Testi
President
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top