I'm currently making a payroll system for our thesis and I'm having trouble when it comes to Time In Time Out. Our panel said that we should put only one button and one textbox. How should I do that. Thanks in advance.
Asked
Active
Viewed 2,698 times
-1
1 Answers
0
You need a timer control and and a single start/stop button. On the first click of the button set the timer to enabled. Show the timer's elapsed time in your textbox. On the next click check if the timer is enabled then measure the timespan between now and when the timer was started.
Full example with code is here: http://markb.co.uk/creating-a-simple-stopwatchtimer-application-with-c-windows-forms.html
banavalikar
- 302
-
-
Use cases:
- First use (Time in):
Button clicked -> Record time to database -> Set time variables to current time -> Start timer
- Second use (Time out):
Button clicked -> Stop timer -> Record elapsed time to database -> Stop timer
Repeat case 1.
Repeat case 2.
time_in_total, for example) you create a nested loop - the outer one iterates the entire array, the inner loop iterates over two array elements (1,2 then 3,4 then 5,6 etc.) and works out the time difference (your "time out" minus your "time in") and add this to a total - display this in your text box, for example. – Kinnectus Aug 24 '15 at 10:21