If this is for a mobile app the it really should be posted in the Mobile forum because the considerations are different. I've asked the mods to move it.

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.