国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

VB6和VB.NET中對光標的編程

2024-07-10 13:07:08
字體:
來源:轉載
供稿:網友

在vb6中利用api對光標進行編程:

option explicitprivate type pointapi    x as long    y as longend typeprivate declare function getcursorpos lib "user32" (lppoint as pointapi) as longprivate declare function showcursor lib "user32" (byval bshow as long) as longpublic function getxcursorpos() as long   dim pt as pointapi   getcursorpos pt   getxcursorpos = pt.xend functionpublic function getycursorpos() as long   dim pt as pointapi   getcursorpos pt   getycursorpos = pt.yend function '得到光標在屏幕中的位置private sub form_mousemove(button as integer, shift as integer, x as single, y as single)    label1.caption = "x screen position = " & getxcursorpos    label2.caption = "y screen position =  " & getycursorposend sub'隱藏光標private sub command1_click()    showcursor falseend sub'顯示光標private sub command2_click()    showcursor trueend sub  

在vb.net中利用cursor 類很簡單地對光標進行編程:(可以獲取和設置光標的位置,設置光標的形狀,顯示和隱藏光標)

   '隱藏光標    private sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click        cursor.hide()    end sub    '得到光標在屏幕中的位置    private sub form2_mousemove(byval sender as object, byval e as system.windows.forms.mouseeventargs) handles mybase.mousemove        me.label1.text = "x screen position = " & cursor.position.x        me.label2.text = "y screen position = " & cursor.position.y    end sub    '顯示光標    private sub button2_click(byval sender as system.object, byval e as system.eventargs) handles button2.click        cursor.show()    end sub

很簡單的東西,更多的實例,可以參考api手冊和framework的文檔。

 

國內最大的酷站演示中心!
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 固镇县| 黄山市| 石楼县| 清水河县| 江油市| 龙里县| 惠州市| 昭苏县| 通州区| 小金县| 湘西| 仙桃市| 石门县| 印江| 阳城县| 赣榆县| 桃园市| 达尔| 满洲里市| 五大连池市| 晋江市| 红河县| 府谷县| 清镇市| 叶城县| 柳州市| 海门市| 宁德市| 鹿泉市| 丹凤县| 望奎县| 得荣县| 仙居县| 和龙市| 平乡县| 永清县| 皋兰县| 乃东县| 修文县| 奉节县| 鄂尔多斯市|