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

📄 状态栏上进度条.frm

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2520
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5295
   LinkTopic       =   "Form1"
   ScaleHeight     =   168
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   353
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "开始"
      Height          =   330
      Left            =   1755
      TabIndex        =   2
      Top             =   945
      Width           =   1050
   End
   Begin VB.Timer Timer1 
      Left            =   4815
      Top             =   1710
   End
   Begin MSComctlLib.ProgressBar ProgressBar1 
      Height          =   285
      Left            =   675
      TabIndex        =   1
      Top             =   1710
      Width           =   2715
      _ExtentX        =   4789
      _ExtentY        =   503
      _Version        =   393216
      Appearance      =   0
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   330
      Left            =   0
      TabIndex        =   0
      Top             =   2190
      Width           =   5295
      _ExtentX        =   9340
      _ExtentY        =   582
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            Object.Width           =   1323
            MinWidth        =   1323
            TextSave        =   "11:34"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   7488
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click()
    Command1.Enabled = False
    ProgressBar1.Min = 0
    ProgressBar1.Max = 100
    ShowProgressInStatusbar True
    Timer1.Enabled = True
End Sub
Private Sub ShowProgressInStatusbar(ByVal bShowProgress As Boolean)
    Dim i As Long
    If bShowProgress Then
        With ProgressBar1
            i = SetParent(.hwnd, StatusBar1.hwnd)
            .Move StatusBar1.Panels(2).Left + 2, 3, StatusBar1.Panels(2).Width - 4, StatusBar1.Height - 4
            .Visible = True
        End With
    Else
        SetParent ProgressBar1.hwnd, Me.hwnd
        ProgressBar1.Visible = False
    End If
End Sub

Private Sub Form_Load()
    ProgressBar1.Visible = False
    Timer1.Enabled = False
    Timer1.Interval = 200
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ShowProgressInStatusbar False
End Sub

Private Sub Timer1_Timer()
    Static INum As Long
    INum = INum + 5
    If INum >= 100 Then
        Timer1.Enabled = False
        ShowProgressInStatusbar False
        Command1.Enabled = True
        INum = 0
    End If
    ProgressBar1.Value = INum
End Sub

⌨️ 快捷键说明

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