Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

'Put a text box in the upper left-hand corner of the form with a small margin on

the left and top of it.


'Draw a PictureBox on the form. Set the Align property to Align Bottom, set the
Appearance to Flat, and set the BackColor to the Menu Bar color. This provides a
place for your Command buttons.
'Draw your OK and Cancel buttons in the PictureBox and center them in the
PictureBox.

Private Sub Form_Resize()

lngSpacer = cmdCancel.Left - cmdOK.Left - cmdOK.Width


lngBttnWidth = lngSpacer + cmdCancel.Width + cmdOK.Width

txtText.Height = picPanel.Top - (2 * txtText.Top)


txtText.Width = Me.ScaleWidth - (2 * txtText.Left)

cmdOK.Left = (picPanel.Width - lngBttnWidth) / 2


cmdCancel.Left = cmdOK.Left + cmdOK.Width + lngSpacer

End Sub

You might also like