Home > Software engineering >  Display the current time Windows forms in code
Display the current time Windows forms in code

Time:10-21

How to display the current time in the window of the Windows forms,

CodePudding user response:

TextOut,
HDC to achieve this window first, and then with a TextOut,


CodePudding user response:

Simply drag a date timer picker controls, then go to refresh the control, can always display the latest time

CodePudding user response:

Or to use
Time_t nowtime;
* timeinfo struct tm;
Time (& amp; Nowtime);
Timeinfo=localtime (& amp; Nowtime);
Get the current system time, and then drag a static control, change the ID under the control, and then obtain the handle to the static, call the SetWindowText to set the text content to obtain the static control
  • Related