訪問地址
中文Access2000速成教程--1.8定義
ACCESS集錦
Access新手來看:Access的特點、概要精通ACCESS需掌握的內容用Access 2000進行班級管理一篇詳細講述mysql和access區別的
中文Access2000速成教程--1.1使用
Access使用查詢
Access 數據庫安全攻防策略
Access命令行參數
問題:
如何設定鼠標指針?
方法一:
Private Declare Function alxSetCursor Lib "user32" Alias "SetCursor" (ByVal hCursor As Long) As Long
'將指定的鼠標指針設為當前指針
Private Declare Function alxGetCursor Lib "user32" Alias "GetCursor" () As Long
'獲取目前選擇的鼠標指針的句柄
Private Sub MouseType()
'取得左右形光標的值
Screen.MousePointer = 9 '設屏幕鼠標為9(左右型鼠標)。
lngMouseOne = alxGetCursor() '返回左右型鼠標在WINDOWS(200098XP)的值。
Screen.MousePointer = 7 '設屏幕鼠標為11(沙漏)。
lngMouseTwo = alxGetCursor() '返回左右型鼠標在WINDOWS(200098XP)的值。
Screen.MousePointer = 0 '重設屏幕鼠標為0(ACCESS自確定)。
blTextout = False
blTextlook = False
End Sub
方法二:
隨便找一個 .cur文件copy到mdb文件相同的目錄
Private Declare Function CopyCursor Lib "user32" Alias "CopyIcon" (ByVal hcur As Long) As Long
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpstrCurFile As String) As Long
Private Declare Function GetCursor Lib "user32" () As Long
Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, ByVal id As Long) As Long
Private Const OCR_NORMAL = 32512
dim lngMyCursor As Long
Dim lngSystemCursor As Long
Private Sub cmdMyCursor_Click() '更改指針樣式
Dim strCurFile As String
strCurFile = CurrentProject.Path + "Cursor.cur"
'可隨意調用其他的.cur鼠標樣式文件,以達到顯示各種指針的目的
lngMyCursor = LoadCursorFromFile(strCurFile)
lngSystemCursor = GetCursor()
lngSystemCursor = CopyCursor(lngSystemCursor)
SetSystemCursor lngMyCursor, OCR_NORMAL
Text1.SetFocus
Text1.Text = "鼠標指針已經設定為您要的狀態"
cmdMyCursor.Enabled = False
cmdSystemCursor.Enabled = True
End Sub
private Sub cmdSystemCursor_Click() '恢復系統指針樣式
SetSystemCursor lngSystemCursor, OCR_NORMAL
Text1.SetFocus
Text1.Text = "鼠標指針已經恢復為系統狀態"
cmdMyCursor.Enabled = True
cmdSystemCursor.Enabled = False
lngSystemCursor = 0
End Sub
private Sub Form_Close()
If lngSystemCursor <> 0 Then SetSystemCursor lngSystemCursor, OCR_NORMAL
End Sub
private Sub Form_Unload(Cancel As Integer)
If lngSystemCursor <> 0 Then SetSystemCursor lngSystemCursor, OCR_NORMAL
End Sub