23866
Goto Top

VB6 - Countdown auf Command Button

Hallo,
wie kann ich auf einer Command Button.Caption einen Countdown zu ordnen?

Der Coutdown soll von 10 - 0 runterzählen und dann in der Button Caption Beenden anzeigen.


Gruß Mike

Content-Key: 24656

Url: https://administrator.de/contentid/24656

Ausgedruckt am: 29.03.2024 um 08:03 Uhr

Mitglied: 23866
23866 01.02.2006 um 17:02:15 Uhr
Goto Top
Hallo,
habs selbst hinbekommen, für die die es interessiert:

Public countdown As String


Private Sub Form_Load()
Me.Command1.Caption = "10"
Me.Command1.Enabled = False
Me.Timer1.Enabled = True
countdown = 10
End Sub

Private Sub Timer1_Timer()

If countdown = 1 Then
Me.Command1.Caption = "Beenden"
Me.Command1.Enabled = True
Me.Timer1.Enabled = False
Else
countdown = countdown - 1
Me.Command1.Caption = countdown
End If

End Sub