Здравсвуйте всем жителям!
Вопрос такой: как изменить CommandButton?
Например без углов, или в форме овала.
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 DeleteObject Lib "gdi32" (ByVal hObject 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&
Me.ScaleMode = 3
hRgn = CreateEllipticRgn(Command1.Left, Command1.Top, Command1.Left + Command1.Width, Command1.Top + Command1.Height)
SetWindowRgn Command1.hWnd, hRgn, True
DeleteObject hRgn
End Sub
A.A.Z. писал(а):Это самый простой способ (про регион). Вот пример
- Код: Выделить всё
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 DeleteObject Lib "gdi32" (ByVal hObject 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&
Me.ScaleMode = 3
hRgn = CreateEllipticRgn(Command1.Left, Command1.Top, Command1.Left + Command1.Width, Command1.Top + Command1.Height)
SetWindowRgn Command1.hWnd, hRgn, True
DeleteObject hRgn
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 165