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

📄 form1.frm

📁 很多的vb经典源代码
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "图形的动态显示(百叶窗风格)"
   ClientHeight    =   4545
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6735
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4545
   ScaleWidth      =   6735
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command3 
      Caption         =   "结束程序"
      Height          =   375
      Left            =   5280
      TabIndex        =   7
      Top             =   3960
      Width           =   1335
   End
   Begin MSComCtl2.UpDown UpDown1 
      Height          =   375
      Left            =   2160
      TabIndex        =   6
      Top             =   3960
      Width           =   270
      _ExtentX        =   476
      _ExtentY        =   661
      _Version        =   393216
      Value           =   2
      BuddyControl    =   "Text1"
      BuddyDispid     =   196613
      OrigLeft        =   2760
      OrigTop         =   3960
      OrigRight       =   3030
      OrigBottom      =   4335
      Min             =   1
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1200
      TabIndex        =   4
      Text            =   "2"
      Top             =   3960
      Width           =   945
   End
   Begin VB.CommandButton Command2 
      Caption         =   "三次间隔扫描"
      Height          =   375
      Left            =   3960
      TabIndex        =   3
      Top             =   3960
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "奇偶扫描图形"
      Height          =   375
      Left            =   2640
      TabIndex        =   2
      Top             =   3960
      Width           =   1335
   End
   Begin VB.PictureBox Picture2 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      Height          =   3615
      Left            =   720
      ScaleHeight     =   241
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   280
      TabIndex        =   1
      Top             =   120
      Width           =   4200
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BorderStyle     =   0  'None
      Height          =   3600
      Left            =   3600
      Picture         =   "Form1.frx":0000
      ScaleHeight     =   240
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   333
      TabIndex        =   0
      Top             =   120
      Visible         =   0   'False
      Width           =   4995
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "扫描高度:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   120
      TabIndex        =   5
      Top             =   4080
      Width           =   1050
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Dim stepheight, width2, height2, i, j, num As Long
Picture2.width = Picture1.width
Picture2.height = Picture1.height
stepheight = Val(Text1.Text)
width2 = Picture1.ScaleWidth
height2 = Picture1.ScaleHeight
num = Int(height2 / stepheight)   '获得每次处理的次数
num = Int(num / 2) * 2
Set Picture2.Picture = Nothing
For i = 1 To num Step 2
    Picture2.PaintPicture Picture1.Picture, 0, i * stepheight, , , 0, i * stepheight, width2, stepheight, vbSrcCopy
    DoEvents
    Sleep (10)
Next i
For j = 0 To num - 1 Step 2
    Picture2.PaintPicture Picture1.Picture, 0, j * stepheight, , , 0, j * stepheight, width2, stepheight, vbSrcCopy
    DoEvents
    Sleep (10)
Next j
End Sub

Private Sub Command2_Click()
Dim stepheight, width2, height2, i, j, num As Long
stepheight = Val(Text1.Text)
width2 = Picture1.ScaleWidth
height2 = Picture1.ScaleHeight
num = Int(height2 / stepheight)   '获得每次处理的次数
num = Int(num / 3) * 3
   

Set Picture2.Picture = Nothing
For i = 1 To num Step 3
    Picture2.PaintPicture Picture1.Picture, 0, i * stepheight, , , 0, i * stepheight, width2, stepheight, vbSrcCopy
    DoEvents
    Sleep (30)
Next i
For j = 0 To num - 1 Step 3
    Picture2.PaintPicture Picture1.Picture, 0, j * stepheight, , , 0, j * stepheight, width2, stepheight, vbSrcCopy
    DoEvents
    Sleep (30)
Next j
For j = 2 To num - 1 Step 3
    Picture2.PaintPicture Picture1.Picture, 0, j * stepheight, , , 0, j * stepheight, width2, stepheight, vbSrcCopy
    DoEvents
    Sleep (30)
Next j

End Sub

Private Sub Command3_Click()
    End
End Sub

⌨️ 快捷键说明

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