Option Explicit ' Copyright ?1997 by Desaware Inc. All Rights ReservedPrivate 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 Long) As LongPrivate Sub Command1_Click() Label1.BackColor = RGB(0, 255, 0) Label1.Caption = "Button clicked" Unload Me End Sub Private Sub Form_Load() Dim hr&, dl& Dim usew&, useh& usew& = Me.Width / Screen.TwipsPerPixelX useh& = Me.Height / Screen.TwipsPerPixelY hr& = CreateEllipticRgn(0, 0, usew, useh) dl& = SetWindowRgn(Me.hWnd, hr, True)End Sub Private Sub Picture1_Click() Label1.BackColor = RGB(255, 0, 0) Label1.Caption = "Picture clicked"End Sub
' Copyright ?1997 by Desaware Inc. All Rights ReservedPrivate 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 Long) As LongPrivate Sub Command1_Click()
Label1.BackColor = RGB(0, 255, 0)
Label1.Caption = "Button clicked"
Unload Me
End Sub
Private Sub Form_Load()
Dim hr&, dl&
Dim usew&, useh&
usew& = Me.Width / Screen.TwipsPerPixelX
useh& = Me.Height / Screen.TwipsPerPixelY
hr& = CreateEllipticRgn(0, 0, usew, useh)
dl& = SetWindowRgn(Me.hWnd, hr, True)End Sub
Private Sub Picture1_Click()
Label1.BackColor = RGB(255, 0, 0)
Label1.Caption = "Picture clicked"End Sub
我的信箱:[email protected]