Private Sub Form_Resize() Command1.Left = (Form1.Width - Command1.Width) / 2 Command1.Top = (Form1.Height - Command1.Height) / 2 End Sub