Visual Basic - AYUDA CON PROGRESS BAR

Life is soft - evento anual de software empresarial
 
Vista:

AYUDA CON PROGRESS BAR

Publicado por Jorge (1 intervención) el 24/03/2006 20:00:39
Hola a todos estoy complementando un proyecto en uno de los forms le coloque un progress bar,el proceso es dandole un click en el boton cargar saldra un msgbox confirmando si se desea activar la barra de progreso si es yes continuara y cambiara el boton cargar por cargando y comenzara a funcionar ,pero mi problema es que deseo como condicion el msgbox como "cancel",anular el progress bar para que se detenga,como lo hago en el progress.value?....aqui les mando el codigo de mi diseño aver si me pueden ayudar,esto fue lo que avanze:


Option Explicit

Private Sub cmdSalir_Click()
End
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
End Sub

Private Sub cmdComenzar_Click()
Timer
If cmdcomenzar.Caption = "&Cargar" Then
Progreso.Value = 0
Timer1.Enabled = True
If MsgBox("El proceso esta a punto de ser liberado.¿Desea continuar?", vbQuestion + vbOKCancel + vbDefaultButton1, "Urgente") = vbCancel Then
Progreso.Value = 2
Form1.Show
End If
cmdcomenzar.Caption = "&Cargando"
End If
End Sub

Private Sub Timer1_Timer()
With Progreso
If .Value < .Max Then
.Value = .Value + 1
Else 'Termino
MsgBox "Proceso Terminado", , "Barra de Progreso" 'Deshabilitamos el Timer
End If
End With
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:AYUDA CON PROGRESS BAR

Publicado por LLE (136 intervenciones) el 25/03/2006 22:39:35
Option Explicit

Private Sub cmdSalir_Click()
End
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
End Sub

Private Sub cmdComenzar_Click()

If cmdComenzar.Caption = "&Cargar" Then
Progreso.Value = 0

If MsgBox("El proceso esta a punto de ser liberado.¿Desea continuar?", vbQuestion + vbOKCancel + vbDefaultButton1, "Urgente") = vbCancel Then
Timer1.Enabled = False
Else
Progreso.Value = 2
Form1.Show
Timer1.Enabled = True
cmdComenzar.Caption = "&Cargando"
End If

End If
End Sub

Private Sub Timer1_Timer()
With Progreso
If .Value < .Max Then
.Value = .Value + 1
Else 'Termino
MsgBox "Proceso Terminado", , "Barra de Progreso" 'Deshabilitamos el Timer
Timer1.Enabled = False: Progreso.Value = 0
End If
End With
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar