vb中如何实现进度条满后马上打开另一窗体vb中如何实现进度条满后马上打开另一个窗
1个回答
展开全部
两个窗体,Form1 ,Form2
一个botton控件,一个timer控件,一个ProgressBar1控件,初始值:Min=0 Max=10
程序如下:
Dim i As Integer
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
If i <= 5 Then
ProgressBar1.Value = ProgressBar1.Value + 2
Else: Timer1.Enabled = False
Unload Me
Form2.Show
End If
End Sub
一个botton控件,一个timer控件,一个ProgressBar1控件,初始值:Min=0 Max=10
程序如下:
Dim i As Integer
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
If i <= 5 Then
ProgressBar1.Value = ProgressBar1.Value + 2
Else: Timer1.Enabled = False
Unload Me
Form2.Show
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询