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

📄 绘制网格图像.frm

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4845
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6765
   LinkTopic       =   "Form1"
   ScaleHeight     =   4845
   ScaleWidth      =   6765
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "取消网格"
      Height          =   435
      Left            =   5100
      TabIndex        =   2
      Top             =   2220
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "显示网格"
      Height          =   435
      Left            =   5100
      TabIndex        =   1
      Top             =   1200
      Width           =   1335
   End
   Begin VB.PictureBox Picture1 
      AutoSize        =   -1  'True
      Height          =   4410
      Left            =   540
      Picture         =   "绘制网格图像.frx":0000
      ScaleHeight     =   4350
      ScaleWidth      =   4200
      TabIndex        =   0
      Top             =   180
      Width           =   4260
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim HLinesNum As Long
    Dim WLinesNum As Long
    Dim XX As Long
    Dim I As Long
    Dim J As Long
    Dim YY As Long
    
    HLinesNum = 15
    WLinesNum = 15
    Picture1.Refresh
    Picture1.AutoRedraw = False
    YY = Int(Picture1.ScaleHeight / HLinesNum)
    XX = Int(Picture1.ScaleWidth / WLinesNum)
    For I = 1 To HLinesNum + 1
        Picture1.Line (XX * I, 0)-(XX * I, Picture1.Height - 1)
        Picture1.Line (0, YY * I)-(Picture1.Width - 1, YY * I)
    Next
End Sub

Private Sub Command2_Click()
    Picture1.AutoRedraw = False
    Picture1.Refresh
End Sub

Private Sub Form_Activate()
    Picture1.ForeColor = vbWhite
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Unload Me
    End
End Sub

⌨️ 快捷键说明

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