If you have 3 controls (and the code can be altered to accomodate more), you can use the code below to center one control, and size the two on the sides to fill the gaps:
VB Code:
Me.centerControl.Location = New Point((Me.Width / 2) - (Me.centerControl.Width / 2), (Me.Height / 2) - (Me.centerControl.Height / 2)) Me.leftControl.Width = Me.centerControl.Location.X - 2 Me.rightControl.Width = Me.leftControl.Width - 2
i subtracted 2 from the widths to give some 'breathing room'
pretty simple..Thanks to RobDog for the first line of code




Reply With Quote