Hi, I'm new to vb and I need to record the time the user used a certain privilege and the time s/he finished using it. i used date/time picker but whenever i run the program, i can't edit the time. only the date.

help please?

Recommended Answers

All 4 Replies

Something like this?

timePicker.Format = DateTimePickerFormat.Time;
timePicker.ShowUpDown = true;

You should use a timer instead of Date/time picker
when the user starts

Timer1.start()

when the user finishes

Timer1.stop()

but first you can set the time to seconds, minutes or hours
for seconds use

Timer1.Interval = 1000

now each timer Tick is a second, when the timer start log your time

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim LogTime As Integer = 0
        LogTime = LogTime + 1
    End Sub

i haven't typed codes in my program yet. i just added data sources

I got it now. Thank you so much! You are such a big help! THANK YOU!!! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.