⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 vb电子书籍
💻 FRM
字号:
   VERSION 5.00
   Begin VB.Form Form1
      BackColor       =   &H00FFFFFF&
      Caption         =   "mousemove example"
      ClientHeight    =   2415
      ClientLeft      =   60
      ClientTop       =   345
      ClientWidth     =   4650
      LinkTopic       =   "Form1"
      ScaleHeight     =   2415
      ScaleWidth      =   4650
      StartUpPosition =   2  '屏幕中心
      Begin VB.TextBox Text2
         Appearance      =   0  'Flat
         Height          =   270
         Left            =   1320
         TabIndex        =   2
         Top             =   840
         Width           =   855
      End
      Begin VB.TextBox Text1
         Appearance      =   0  'Flat
         Height          =   270
         Left            =   1320
         TabIndex        =   1
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label1
         BackStyle       =   0  'Transparent
         Caption         =   "X坐标:       Y坐标:"
         BeginProperty Font
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   360
         TabIndex        =   0
         Top             =   360
         Width           =   735
      End
   End
   Attribute VB_Name = "Form1"
   Attribute VB_GlobalNameSpace = False
   Attribute VB_Creatable = False
   Attribute VB_PredeclaredId = True
   Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
Dim drawstate As Boolean
Dim prex As Single
Dim prey As Single

'##################################################################
'## 过程名称:Form_Load
'## 参数: 无
'##################################################################
Private Sub Form_Load()
    drawstate = False
    
End Sub
    
'##################################################################
'## 过程名称:Form_MouseDown
'## 参数:Button 为Integer型
'## 参数:Shift 为Integer型
'## 参数:X 为Single型
'## 参数:Y 为Single型
'##################################################################
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
        MousePointer = vbCustom
        MouseIcon = LoadPicture(App.Path + "\pen.ico")
        prex = X - 220
        prey = Y + 220
    End If
    If Button = 2 Then
        Circle (X, Y), 280
    End If
End Sub
    
'##################################################################
'## 过程名称:Form_MouseMove
'## 参数:Button 为Integer型
'## 参数:Shift 为Integer型
'## 参数:X 为Single型
'## 参数:Y 为Single型
'##################################################################
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Text1.Text = X
    Text2.Text = Y
    
    Line (prex, prey)-(X - 220, Y + 220)
    prex = X - 220
    prey = Y + 220
    
End Sub
    
'##################################################################
'## 过程名称:Form_MouseUp
'## 参数:Button 为Integer型
'## 参数:Shift 为Integer型
'## 参数:X 为Single型
'## 参数:Y 为Single型
'##################################################################
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
        MousePointer = vbDefault
        drawstate = False
    End If
    
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -