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

📄 form1.frm

📁 vb精彩编程希望大家有用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "进度条"
   ClientHeight    =   2940
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5295
   LinkTopic       =   "Form1"
   ScaleHeight     =   2940
   ScaleWidth      =   5295
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Left            =   240
      Top             =   720
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      Height          =   495
      Left            =   3360
      TabIndex        =   5
      Top             =   2160
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "暂停"
      Height          =   495
      Left            =   2040
      TabIndex        =   4
      Top             =   2160
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "开始"
      Height          =   495
      Left            =   720
      TabIndex        =   3
      Top             =   2160
      Width           =   1215
   End
   Begin VB.PictureBox Picture2 
      Height          =   495
      Left            =   720
      ScaleHeight     =   435
      ScaleWidth      =   1155
      TabIndex        =   1
      Top             =   720
      Width           =   1215
   End
   Begin VB.PictureBox Picture1 
      Height          =   495
      Left            =   2160
      ScaleHeight     =   435
      ScaleWidth      =   1155
      TabIndex        =   0
      Top             =   720
      Width           =   1215
   End
   Begin VB.Label Label1 
      Height          =   495
      Left            =   1920
      TabIndex        =   2
      Top             =   1440
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Command1_Click()
    If i < 100 Then
        Timer1.Enabled = True
        Label1.Caption = "正在复制文件..."
    Else
        Label1.Caption = "文件复制完毕!"
    End If
End Sub
Private Sub Command2_Click()
    If i < 100 Then
        If Command2.Caption = "暂停" Then
            Command2.Caption = "继续"
            Timer1.Enabled = False
            Label1.Caption = "文件复制暂停"
        Else
            Command2.Caption = "暂停"
            Timer1.Enabled = True
            Label1.Caption = "正在复制文件..."
        End If
    Else
        Label1.Caption = "文件复制完毕!"
    End If
End Sub
Private Sub Command3_Click()
    Unload Me
End Sub
Private Sub Form_Load()
    i = 0
    Picture1.Top = Picture2.Top
    Picture1.Height = Picture2.Height
    Picture1.Left = Picture2.Left
    Picture2.Width = 1
    Picture2.BackColor = vbRed
    Picture1.BackColor = vbBlack
    Picture1.Width = 4000
    Timer1.Interval = 100
    Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
    If i < 100 Then
        i = i + 1
        Picture2.Width = i * 40
        Label1.Caption = "已完成" & Str(i) & " " & "%"
    End If
End Sub

⌨️ 快捷键说明

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