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 = 20
End Sub
Private Sub form_Unload(Cancel As Integer)
ShowProgresslnStatusBar False
'把进度条控件的容器还原为窗体
End Sub
Private Sub timer1_timer()
Static inum As Long
inum = inum + 5
If inum > 100 Then
Timer1.Enabled = False
ShowProgresslnStatusBar False
Command1.Enabled = True
inum = 0
End If
ProgressBar1.Value = inum
End Sub
MODULE1中代码:
Option Explicit
Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)
Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public Type RECT
Left As Long
Top As Long
Roght As Long
Bottom As Long
End Type