On Feb 3, 9:57 pm, "Chris Saunders" <e...@mountaincable.netwrote:
This is not actually a C# question but I'm not sure which newsgroup is
appropriate for
this question. My apologies if I'm being "off-topic".
I'm writing and application that has a group box that contains a bunch of
radio buttons
and wish to keep this group box and its buttons centered when the width of
the window
is changed. I do know how to accomplish this using code but I wonder if
there is a
simpler method? I'm using Visual Studio 2005 to write this application.
You may be stuck doing this in code. The best chance you have for
doing it using layout containers would be the standard
TableLayoutPanel, but even that doesn't let you center things easily.
You could make a 3 x 3 table and put your control in the center. You
could then set the second row's RowStyle to Absolute, and the second
column's ColumnStyle to Absolute, and set the others to 50 Percent.
http://msdn2.microsoft.com/en-us/lib...rowstyles.aspx
If you're lucky, this will cause the center cell to stay the size you
want it, while allocating half the remaining space to the top and
bottom rows, and the right and left columns of the table layout. I
make no promises though: I haven't tried it myself. :-)
Also, check out the following;
http://msdn2.microsoft.com/en-us/library/ms171691.aspx