Código:
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Sub Form_Load()
Dim hRgn As Long
With Command1
hRgn = CreateRoundRectRgn(0, 0, .Width / Screen.TwipsPerPixelX, .Height / Screen.TwipsPerPixelY, 1000 / Screen.TwipsPerPixelX, 1000 / Screen.TwipsPerPixelY)
SetWindowRgn .hwnd, hRgn, True
End With
With Command2
hRgn = CreateEllipticRgn(0, 0, .Width / Screen.TwipsPerPixelX, .Height / Screen.TwipsPerPixelY)
SetWindowRgn .hwnd, hRgn, True
End With
End Sub