Quote Originally Posted by jmcilhinney View Post
You should handle the Click event of the Button and set its Enabled property to False. You can then calculate the amount of time until midnight and use that to set the Interval of a Timer, which you then Start. When the Timer Ticks, you enable the Button. This will work in a PC app and I assume a mobile app too, but I'm not 100% sure.
I don't know if this is a good option, because once the user quits the app and comes back in the button would be re-enabled. I think the OP might be better off persisting that information in a file or registry and using a timer to read the value every few seconds/minutes depending on the desired functionality.