所需要的控件:Command1
在Form1中添加一个 Command 控件
然后在Form1中添加以下代码:
在Form1中添加一个 Command 控件
然后在Form1中添加以下代码:
'代码开始
Option Explicit
Option Explicit
Private Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const GCL_STYLE = ( - 26)
Const CS_DROPSHADOW As Long = 131072
Private Sub Command1_Click()
pRemoveDropShadowStyle Me.hwnd
End Sub
Private Sub Form_Load()
Command1.Move 2730, 2205, 1000, 500
Command1.Caption = "Remove Shodow"
pSetDropShadowStyle Me.hwnd
End Sub
Public Sub pSetDropShadowStyle(ByVal hwnd As Long)
If (GetClassLong(hwnd, GCL_STYLE) And CS_DROPSHADOW) = 0 Then
SetClassLong hwnd, GCL_STYLE, GetClassLong(hwnd, GCL_STYLE) or CS_DROPSHADOW
End If
End Sub
Public Sub pRemoveDropShadowStyle(ByVal hwnd As Long)
If GetClassLong(hwnd, GCL_STYLE) And CS_DROPSHADOW Then
Me.Hide
SetClassLong hwnd, GCL_STYLE, GetClassLong(hwnd, GCL_STYLE) Xor CS_DROPSHADOW
Me.Show
End If
End Sub
'代码结束
效果图:
没有评论:
发表评论