动态移动控件

发表于:2007-05-25来源:作者:点击数: 标签:移动DeclarePrivate动态控件
Private Declare Function SendMessage Lib "user32" Alias _ "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, lParam As Any) As Long Const WM_SYSCOMMAND = H112 Const SC_MOVE = HF012 '---- 在 窗 体 中 添 加 一 命

Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Const WM_SYSCOMMAND = &H112
Const SC_MOVE = &HF012

'---- 在 窗 体 中 添 加 一 命 令 按 钮Command1, 双 击 写 代 码 如 下:

Private Sub Command1_Click()
Dim ren as integer
ren = SendMessage(Command1.hwnd, WM_SYSCOMMAND, SC_MOVE, 0)
End Sub

'---- 在 窗 体 中 添 加 命 令 按 钮Command2, 双 击 写 如 下 代 码:

Private Sub Command2_Click()
Unload Me
End Sub

原文转自:http://www.ltesting.net