timer within class and return data

shortcircuit

New member
Joined
Dec 20, 2004
Messages
3
Programming Experience
10+
'how can i access this class, without putting a timer of the form, i.e the form 'loads and continues to read label.text

PrivateClass clock
Inherits Time
PublicFunction systemtime()
IfMe.Enabled = FalseThen
Me.Interval = 500
Me.Enabled = True
EndIf
systemtime = Now.Second
EndFunction

PrivateSub Test_Tick(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Tick

systemtime()
EndSub

EndClass

FriendClass Count

Dim test AsNew clock

Dim timer1 AsNew clock

PublicFunction displaytime() AsString

displaytime = timer1.systemtime

EndFunction

EndClass

PrivateSub Form1_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Load

Dim test AsNew Count

Label1.Text = test.displaytime() 'this only happens once

EndSub

End
Class


'is there a way of running this class and passing the data to the label withing the timer class?
 
Back
Top