vb中用滑块(slider)如何表示进度?如何复位??
1个回答
展开全部
'新建工程,添加一滚动条,一标签,一计时器,二按钮,直接复制代码即可演示
Dim Ss As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
Label1.Caption = "正在执行。。。"
End Sub
Private Sub Command2_Click()
ProgressBar1.Value=0 '复位
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Command2.Caption = "复位"
Timer1.Interval = 100
Timer1.Enabled = False
ProgressBar1.Scrolling = ccScrollingSmooth
ProgressBar1.Max = 100
ProgressBar1.Min = 0
End Sub
Private Sub Timer1_Timer()
Ss = Ss + 1
If Ss = 100 Then
Label1.Caption = "演示完成!"
Timer1.Enabled=False
End If
End Sub
Dim Ss As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
Label1.Caption = "正在执行。。。"
End Sub
Private Sub Command2_Click()
ProgressBar1.Value=0 '复位
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Command2.Caption = "复位"
Timer1.Interval = 100
Timer1.Enabled = False
ProgressBar1.Scrolling = ccScrollingSmooth
ProgressBar1.Max = 100
ProgressBar1.Min = 0
End Sub
Private Sub Timer1_Timer()
Ss = Ss + 1
If Ss = 100 Then
Label1.Caption = "演示完成!"
Timer1.Enabled=False
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询