Tuesday, February 22, 2011

Center a Control on a Form in .NET

It turns out to be very easy to center a control on a .NET form. Just un-anchor the control from any side and it will center from its position. If you just un-anchor from the left and right it will center horizontally, and if you just un-anchor from the top and bottom, it will center vertically. Un-anchor from all sides and it will center on the form.

More info at:

http://stackoverflow.com/questions/491399/c-centering-controls-within-a-form-in-net-winforms

0 comments: