Thread: Date and Time
View Single Post
Old Jul 6th, 2007, 10:49 PM   #6
Ben.Dougall
Programmer
 
Ben.Dougall's Avatar
 
Join Date: Jul 2007
Location: London, Ontario, Canada
Posts: 34
Rep Power: 0 Ben.Dougall is on a distinguished road
Send a message via MSN to Ben.Dougall
Very simple example to show what i think you want. Make a form, with a label, and two buttons, IF you click the first button starts the timer ( <timername>.start() ), second button ( <timername.stop> ). The rest you should be able to get from the code below.

vb Syntax (Toggle Plain Text)
  1. Public Class Form1
  2.  
  3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4. Timer1.Start()
  5. End Sub
  6.  
  7. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  8. Timer1.Stop()
  9.  
  10. End Sub
  11.  
  12. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  13. Label1.Text = DateTime.Now()
  14. End Sub
  15. End Class


The attached is a all the files from my little test project, made in VS2005 SP1.
Attached Files
File Type: zip RandomStuff.zip (14.1 KB, 5 views)
Ben.Dougall is offline   Reply With Quote