Placing control(s) in middle of line on form

  • Thread starter Thread starter Jonathan Blitz
  • Start date Start date
J

Jonathan Blitz

Is there any way I can format a control so that it is in the middle of a
form.

For example, if I have a button at the bottom of my form I want it to the
same distance from the left of the form as from the right.

--
Jonathan Blitz
AnyKey Limited
Israel

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
Try this if you want to center Command0

Private Sub Form_Open(Cancel As Integer)

Me.Command0.Left = (Me.Width / 2) - (Me.Command0.Width / 2)

' if you want to know the number then divide the above number in twips
(1440) to get inches. The you can use that number 'to center it during
design mode
MsgBox Me.Command0.Left / 1440

End Sub

Rodrigo.
 
Back
Top