主题:timer问题
kskksk
[专家分:620] 发布于 2005-12-04 20:22:00
怎么在StatusBar中动态显示当前系统时间.
谢谢!!
回复列表 (共2个回复)
沙发
shuiziliu [专家分:300] 发布于 2005-12-05 09:08:00
statusBar1的属性Panels中追加一个statusbarpabel1然后卸下下面的代码即可(别忘记timer1的eEnabled属性设为true)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
StatusBar1.ShowPanels = True
StatusBar1.Panels(0).Text = "time:" & Now.ToLongTimeString
End Sub
板凳
宝宝啊呜 [专家分:990] 发布于 2005-12-05 09:12:00
要自己做一个时间控制器的
Private Sub Form14_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.StatusBarPanel1.Text = TimeString
Timer1.Interval = 100
Timer1.Start()
End Sub
我来回复