复制代码
- '在模块中声明API函数
- Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
- '光标移到按钮上时变成手形
- Private Sub Command0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- SetCursor 65567
- End Sub
复制代码
- '在模块中声明API函数
- Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
- Public Declare Function LoadCursorByNum Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
- '光标移到按钮上时变成手形
- Private Sub Command0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- SetCursor LoadCursorByNum(0, 32649)
- End Sub
另外为了减少代码,当不需要在鼠标移动事件中进行其它处理时,我们可以直接将按钮的“鼠标移动”属性设为:=SetCursor(LoadCursorByNum(0, 32649))
该方法还可以设置其它指针形状,把示例改了一下,一并发上来
[attach]43525[/attach]
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) | Powered by Discuz! X3.3 |