|
-
Jan 12th, 2010, 04:47 PM
#1
Thread Starter
Junior Member
start time/ stop time
I am using VB 2008 and want to record a start date and time and then the stop date and time in a rich text box, i can get the start time into the box but so far can only stop the time instead of 2 seperate times, what i have is a drop down box with a list of computers 1-10 i was trying to get it so you picked a certain computer and that went into the text box then you started the timer and that was recorded, finally you stopped the timer and that was recorded but as i am a total newbie it does not work
here is the code i have.
Public Class Form1
Dim time2 As Date
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = System.DateTime.Now
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
rtxtbox.Text = System.DateTime.Now
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstart.Click
Timer2.Enabled = True
rtxtbox.Text = rtxtbox.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnend.Click
Timer2.Enabled = False
rtxtbox.Text = rtxtbox.Text
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbocomp.SelectedIndexChanged
rtxtbox.text = rtxtbox.text & cbocomp.selecteditem
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|