真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

VB.net鼠標(biāo)類(lèi) vb 鼠標(biāo)點(diǎn)擊

VB.NET模擬鼠標(biāo)問(wèn)題

Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)

創(chuàng)新互聯(lián)專(zhuān)注網(wǎng)站設(shè)計(jì),以設(shè)計(jì)驅(qū)動(dòng)企業(yè)價(jià)值的持續(xù)增長(zhǎng),網(wǎng)站,看似簡(jiǎn)單卻每一個(gè)企業(yè)都需要——設(shè)計(jì),看似簡(jiǎn)潔卻是每一位設(shè)計(jì)師的心血 十載來(lái),我們只專(zhuān)注做網(wǎng)站。認(rèn)真對(duì)待每一個(gè)客戶(hù),我們不用口頭的語(yǔ)言來(lái)吹擂我們的優(yōu)秀,近1000家的成功案例見(jiàn)證著我們的成長(zhǎng)。

Dim postion1 As New Point

mouse_event(H1 Or H8000, postion1.X * 65535 / 1366, postion1.Y * 65535 / 768, 0, 0)

'按絕對(duì)位置移動(dòng)鼠標(biāo)

'在鼠標(biāo)坐標(biāo)系統(tǒng)中,屏幕在水平和垂直方向上均勻分割成65535×65535個(gè)單元,

'當(dāng)前所用顯示屏分辨率為1366*768

'所以要進(jìn)行如上轉(zhuǎn)換

mouse_event(H2, 0, 0, 0, 0) '鼠標(biāo)左鍵按下

mouse_event(H4, 0, 0, 0, 0) '鼠標(biāo)左鍵彈起

msdn上有 mouse_event 的詳解,大致使用如上

如何在VB.net中用程序控制鼠標(biāo)移動(dòng)和點(diǎn)擊

調(diào)用api

在Visual Baisc.net中的聲明:

Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Public Const MOUSEEVENTF_LEFTDOWN = H2 '模擬鼠標(biāo)左鍵按下

Public Const MOUSEEVENTF_LEFTUP = H4 ’模擬鼠標(biāo)左鍵釋放

Public Const MOUSEEVENTF_MIDDLEDOWN = H20 '模擬鼠標(biāo)中間鍵按下

Public Const MOUSEEVENTF_MIDDLEUP = H40 '模擬鼠標(biāo)中間鍵釋放

Public Const MOUSEEVENTF_RIGHTDOWN = H8 '模擬鼠標(biāo)右鍵按下

Public Const MOUSEEVENTF_RIGHTUP = H10 '模擬鼠標(biāo)右鍵釋放

Public Const MOUSEEVENTF_MOVE = H1 '模擬鼠標(biāo)指針移動(dòng)

例:

mouse_event MOUSEEVENTF_LEFTDOWN,10,10,0,0

'在(10,10)模擬鼠標(biāo)左鍵按下

vb.net中,如何實(shí)現(xiàn)鼠標(biāo)在listbox控件上移動(dòng)時(shí),鼠標(biāo)所到的條目背景變黑、字變白;移開(kāi)后還原?

復(fù)雜的不會(huì),來(lái)點(diǎn)兒簡(jiǎn)單的,借用在listbox里按下鼠標(biāo)時(shí)再移動(dòng),會(huì)高亮顯示選擇行,并且會(huì)隨鼠標(biāo)移動(dòng)而變化的這一特點(diǎn)改進(jìn)的,不足之處是在listbox里,此時(shí)處于鼠標(biāo)左鍵在按下?tīng)顟B(tài)。

Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Public Const MOUSEEVENTF_LEFTDOWN = H2 '模擬鼠標(biāo)左鍵按下

Private Sub ListBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles ListBox1.MouseMove

mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)

End Sub


文章標(biāo)題:VB.net鼠標(biāo)類(lèi) vb 鼠標(biāo)點(diǎn)擊
網(wǎng)站URL:http://weahome.cn/article/dogpdhg.html

其他資訊

在線(xiàn)咨詢(xún)

微信咨詢(xún)

電話(huà)咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部