鼠标问题
一共有3个鼠标文件,分别为 1.cur 2.cur 3.ani当鼠标没有在任何控件上时:使用1.cur
当鼠标按下时(点击时,没有弹起时):使用2.cur
当鼠标移动到窗体中的任意按钮上时:使用3.ani
怎么实现啊?
达人门注意下,3.ani是动态的哦! --------------------编程问答-------------------- 看MSDN怎么设置鼠标属性。 --------------------编程问答--------------------
Public Declare Function LoadCursorFromFile& Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String)
Public Declare Function GetCursor Lib "user32" () As Long
Public Declare Function CopyIcon Lib "user32" (ByVal hIcon As Long) As Long
Public Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, ByVal id As Long) As Long
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'过程功能:设置屏幕鼠标图形
'功能描述:设置为动态光标
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Public Sub subSetAniCursor(ByVal strCursorFile As String)
Dim Cursor As Long
Dim Cursor2 As Long
Cursor = LoadCursorFromFile(strCursorFile)
Screen.MousePointer = 2 '选一个不常用的光标类型
Cursor2 = GetCursor
HoldCursor = CopyIcon(Cursor2)
'如果第二个参数用OCR_NORMAL,则会把屏幕上默认的箭头光标替换为动画光标
Call SetSystemCursor(Cursor, OCR_CROSS)
End Sub
补充:VB , 基础类