P
Paul Schwann
Hi group,
I have a problem with setting the size of a form. Setting some (hard
coded) size in pixels (width/height) works of course. The question I
always had is: How can I determine the perfect size for my form? With
"perfect size" I mean the width and height a form needs to have to
perfectly fit all the components (buttons, labels, text fields etc)
with respect to the margins, paddings and layout constraints WITHOUT
being too big or too small.
Even if start counting the pixels for each component it is a waste of
time because if a different system font a system theme or screen
resolution is used, the size (in pixels) changes.
In Java/AWT, there is function pack() which does exactly this. Is
there an equivalent in C#/.NET/Winforms?
It is also important that this function can be called during runtime.
Some of my forms have a dynamic content based on user selections.
Thus, the "perfect size" needs to be recomputed now and than...
Thanks for any ideas!
Regards,
Paul
I have a problem with setting the size of a form. Setting some (hard
coded) size in pixels (width/height) works of course. The question I
always had is: How can I determine the perfect size for my form? With
"perfect size" I mean the width and height a form needs to have to
perfectly fit all the components (buttons, labels, text fields etc)
with respect to the margins, paddings and layout constraints WITHOUT
being too big or too small.
Even if start counting the pixels for each component it is a waste of
time because if a different system font a system theme or screen
resolution is used, the size (in pixels) changes.
In Java/AWT, there is function pack() which does exactly this. Is
there an equivalent in C#/.NET/Winforms?
It is also important that this function can be called during runtime.
Some of my forms have a dynamic content based on user selections.
Thus, the "perfect size" needs to be recomputed now and than...
Thanks for any ideas!
Regards,
Paul