?? mousedemo.frm
字號:
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 3 'Fixed Dialog
Caption = "鼠標大表演"
ClientHeight = 4245
ClientLeft = 45
ClientTop = 330
ClientWidth = 5370
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4245
ScaleWidth = 5370
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
Height = 3975
Left = 3960
ScaleHeight = 3915
ScaleWidth = 1155
TabIndex = 0
Top = 120
Width = 1215
Begin VB.CommandButton Command8
Caption = "關閉"
Height = 375
Left = 120
TabIndex = 9
Top = 3480
Width = 975
End
Begin VB.CommandButton Command7
Caption = "鼠標鍵數"
Height = 375
Left = 120
TabIndex = 8
Top = 3000
Width = 975
End
Begin VB.CommandButton Command6
Caption = "設置鼠標"
Height = 375
Left = 120
TabIndex = 7
Top = 2520
Width = 975
End
Begin VB.CommandButton Command5
Caption = "鼠標坐標"
Height = 375
Left = 120
TabIndex = 6
Top = 2040
Width = 975
End
Begin VB.CommandButton Command4
Caption = "移動鼠標"
Height = 375
Left = 120
TabIndex = 5
Top = 1560
Width = 975
End
Begin VB.CommandButton Command3
Caption = "定位鼠標"
Height = 375
Left = 120
TabIndex = 4
Top = 1080
Width = 975
End
Begin VB.CommandButton Command2
Caption = "顯示鼠標"
Enabled = 0 'False
Height = 375
Left = 120
TabIndex = 3
Top = 600
Width = 975
End
Begin VB.CommandButton Command1
Caption = "隱藏鼠標"
Height = 375
Left = 120
TabIndex = 1
Top = 120
Width = 975
End
End
Begin VB.Label Label2
Caption = "為了避免鼠標丟失,請按提示操作!"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 1995
Left = 1560
TabIndex = 10
Top = 1980
Width = 555
End
Begin VB.Label Label1
AutoSize = -1 'True
ForeColor = &H000000FF&
Height = 180
Left = 120
TabIndex = 2
Top = 120
Width = 90
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'----------------------
' 作者:段東良
' 99.5.17
'----------------------
Private Sub Command1_Click()
'隱藏鼠標
Label1.Caption = "按Tab鍵使‘顯示鼠標’得到焦點,敲回車!"
Command2.Enabled = True
ShowCursor False
End Sub
Private Sub Command2_Click()
'顯示鼠標
Label1.Caption = ""
Command2.Enabled = False
ShowCursor True
End Sub
Private Sub Command3_Click()
'定位鼠標
Dim x As Long, y As Long
Dim newrect As rect
x& = Screen.TwipsPerPixelX
y& = Screen.TwipsPerPixelY
Label1.Caption = "鼠標在這里!"
'將鼠標定位在Label1中
With newrect
.sbleft = frmMain.Left / x + Label1.Left / x
.sbtop = frmMain.Top / x + Label1.Top / x + (frmMain.Height - frmMain.ScaleHeight) / x
.sbright = .sbleft + Label1.Width / x
.sbbottom = .sbtop + Label1.Height / x
End With
ClipCursor newrect
Label2.Caption = "請單擊一下!"
End Sub
Private Sub Command4_Click()
'移動鼠標
Label1.Caption = "鼠標在屏幕的左上角!"
SetCursorPos 0, 0
End Sub
Private Sub Command5_Click()
'鼠標坐標
Dim z As POINTAPI
GetCursorPos z
Label1.Caption = "x: " & z.x & " y: " & z.y
End Sub
Private Sub Command6_Click()
'設置鼠標
frmMain.MousePointer = 11
Label2.Caption = "在窗體空白處單擊一下!"
End Sub
Private Sub Command7_Click()
'鼠標鍵數
Dim mousebtn As Long
mousebtn = GetSystemMetrics(43)
Label1.Caption = "你的鼠標是 " & mousebtn & " 鍵鼠標!"
End Sub
Private Sub Command8_Click()
End
End Sub
Private Sub Form_Click()
Me.MousePointer = 0
Label2.Caption = ""
End Sub
Private Sub Label1_Click()
'使鼠標恢復
Dim newrect As rect
With newrect
.sbleft = 0
.sbtop = 0
.sbright = Screen.Width / Screen.TwipsPerPixelX
.sbbottom = Screen.Height / Screen.TwipsPerPixelY
End With
ClipCursor newrect
Label2.Caption = ""
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -