exer56.frm

来自「VB6.0应用例题」· FRM 代码 · 共 37 行

FRM
37
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "简单画笔程序"
   ClientHeight    =   2490
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5505
   LinkTopic       =   "Form1"
   ScaleHeight     =   2490
   ScaleWidth      =   5505
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim PaintNow As Boolean
Private Sub Form_Load()
    DrawWidth = 5            '注:设置画点的宽度
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
        PaintNow = True      '注:按下鼠标左键时允许绘图
    End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If PaintNow Then
        PSet (X, Y)          '注:线条由Pset( )函数所画的点连接而成
    End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    PaintNow = False         '注:放开鼠标按钮时,停止绘图
End Sub


⌨️ 快捷键说明

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