国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
如何用程序控制滑鼠游標(biāo)
70、如何用程序控制滑鼠游標(biāo) (Mouse Cursor) 到指定位置?
以下這個(gè)例子,當(dāng) User 在 Text1 中按下 ‘Enter‘ 鍵后,滑鼠游標(biāo)會(huì)自動(dòng)移到 Command2 按鈕上方
請(qǐng)?jiān)诼暶鲄^(qū)中加入以下聲明:
‘16 位版本: ( Sub 無傳回值 )
Declare Sub SetCursorPos Lib "User" (ByVal X As Integer, ByVal Y As Integer)
‘32 位版本: ( Function 有傳回值,Integer 改成 Long )
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
‘在 Form1 中加入以下程序碼:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
x% = (Form1.Left + Command2.Left + Command2.Width / 2 + 60) / Screen.TwipsPerPixelX
y% = (Form1.Top + Command2.Top + Command2.Height / 2 + 360) / Screen.TwipsPerPixelY
SetCursorPos x%, y%
End If
End Sub

71、如何用鼠標(biāo)移動(dòng)沒有標(biāo)題的 Form,或移動(dòng) Form 中的控制項(xiàng)?
在聲明區(qū)中放入以下聲明:
‘16 位版本: ( Sub 無返回值 )
Private Declare Sub ReleaseCapture Lib "User" ()
Private Declare Sub SendMessage Lib "User" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Long)
‘32 位版本: ( Function 有返回值,Integer 改成 Long )
Private Declare Function ReleaseCapture Lib "user32" () As Long
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
‘共用常數(shù):
Const WM_SYSCOMMAND = &H112
Const SC_MOVE = &HF012
‘若要移動(dòng) Form,程序碼如下:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Long
i = ReleaseCapture
i = SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MOVE, 0)
End Sub
‘以上功能也適用于用鼠標(biāo)在 Form 中移動(dòng)控制項(xiàng),程序碼如下:
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Long
i = ReleaseCapture
i = SendMessage(Command1.hwnd, WM_SYSCOMMAND, SC_MOVE, 0)
End Sub
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VB編外掛的一些基礎(chǔ)知識(shí)
VB實(shí)用代碼,收藏??!
VB問題全功略(14)listbox 和combox
VB調(diào)用DLL
VB怎么移動(dòng)鼠標(biāo)到指定位置
vb禁止關(guān)機(jī)的代碼
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服