Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to set a time like "2:00:00 PM" and run it by minutes. But Im not getting the current time on my computer I just want to set a time when i entered a time in textbox and show it to the label then it will run and also the interval of my timer is equal to 1. i try this code but nothing happened. can anyone help me thank you

What I have tried:

Private Sub Form_Load()
timer1.enabled = true
End Sub

Private Sub Timer1_Timer()
Label1.Caption = "2:00:00 PM"
End Sub
Posted
Updated 24-Feb-16 22:07pm

1 solution

Your code does not really do anything very useful. I suggest you look at Timer Class (System.Timers)[^] for details on how to use a timer.

[edit]
Sorry, the above was for VB.NET. If you insist on working with a language that has been dead for years, then see Understanding the timer control | Visual Basic 6 (VB6)[^].
[/edit]
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900