随意划线.frm

来自「学习VB以来的心得体会」· FRM 代码 · 共 55 行

FRM
55
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Left            =   1200
      Top             =   600
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Dim bool As Boolean
Dim x1 As Integer, y1 As Integer
Dim x2 As Integer, y2 As Integer


Private Sub Form_Click()
 bool = False
 DrawMode = 13
 DrawWidth = 10
 BackColor = vbBlack
 Timer1.Interval = 10
 
End Sub



Private Sub Timer1_Timer()
 If bool = False Then
    Randomize
    x1 = Int(3000 * Rnd + 1)
    Randomize
    y1 = Int(3000 * Rnd(6) + 1)
    Randomize
    x2 = Int(3000 * Rnd(8) + 1)
    Randomize
    y2 = Int(3000 * Rnd(9) + 1)
    Line (x1, y1)-(x2, y2), vbWhite
    DrawMode = 7
    Line (x1, y1)-(x2, y2), vbRed
    End If
End Sub

⌨️ 快捷键说明

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