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

Printed on: April 26, 2024 at 18:04 o'clock

Mitglied: 23866
23866 Feb 01, 2006 at 16:02:15 (UTC)
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