Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Sub Command1_Click()
MsgBox "123"
End Sub
Private Sub Command2_Click()
PostMessage Command1.hwnd, WM_LBUTTONDOWN, 0, 0
PostMessage Command1.hwnd, WM_LBUTTONUP, 0, 0
End Sub
一楼正解
不对