0

Which event is to get midnight time in c# winforms? I need to clear all data's in my datagridview after midnight.

rahul s
  • 29
  • 7
  • check here:http://stackoverflow.com/questions/3053695/background-worker-check-for-when-its-midnight – Vahid Farahmandian Jun 13 '16 at 04:47
  • Remember the last date the clearing code ran, and fire an event every 10 seconds or so, and run your code when the event fired for the first time in the day (and remember that day). Rinse and repeat. – Enigmativity Jun 13 '16 at 04:47
  • There is no such event in winforms, and I doubt there is one in any other UI framework in .Net. You can use a timer, and in it's tick event check the current value of `DateTime.Now` to see what time it is. – Zohar Peled Jun 13 '16 at 05:14

0 Answers0