在标签vb6上设置时间 [英] Set time on label vb6
问题描述
我想设置像2:00:00 PM这样的时间并按分钟运行。但我没有得到我的计算机上的当前时间我只想设置一个时间,当我在文本框中输入一个时间并显示到标签然后它将运行,我的计时器的间隔等于1.我试试这个代码但什么都没发生。任何人都可以帮我谢谢
我尝试过:
Private Sub Form_Load()
timer1.enabled = true
End Sub
Private Sub Timer1_Timer()
Label1.Caption =2:00:00 PM
结束Sub
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
推荐答案
您的代码没有真的做任何非常有用的事。我建议你看看 Timer Class(System.Timers) [ ^ ]了解详情关于如何使用计时器。
对不起,以上是针对VB.NET的。如果您坚持使用已经死亡多年的语言,请参阅了解计时器控制Visual Basic 6(VB6) [ ^ ]。
[/ edit]
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]
这篇关于在标签vb6上设置时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!