Click here to Skip to main content
15,885,737 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have this program which i have to create. So, basically there will be a timer which will keep running in the background. Say, every time the user presses a click button,it shows a message of the time the user has pressed the click button and when the user clicks the exit button, the timer shows the time again when the user exited the form.

Is there a way that i can do it?
Posted

1 solution

You don't need a timer for that. You just need to handle a button click event (see, for instance: "The Click Event"[^]) and show the time provided by DateTime.Now Property[^]).
You should as well handle the form OnClosing[^] event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900