| |

VerySource

 Forgot password?
 Register
Search
View: 665|Reply: 4

How to add time and display in conversation based mode in MFC

[Copy link]

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-19 07:00:01
| Show all posts |Read mode
I have now established a dialog-based interface. I want to use the common controls in MFC to add a small window to display the time and make it change with time. What controls should I use and can I use the edit box? But i won't, please advise
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-5-1 01:15:01
| Show all posts
Use WM_TIMER message
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Great Britain

Post time: 2020-5-1 17:00:02
| Show all posts
Use the edit box to respond to the WM_TIMER message and write the current time to the edit box every second.

The following is the content of the OnTimer function:
================================================== ===============

CTime t = CTime :: GetCurrentTime ();

m_Edit = t.Format ("% H:% M:% S");

================================================== ===============
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-5-1 19:30:01
| Show all posts
One sentence above is missing:

UpdateData (FALSE);
Reply

Use magic Report

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-31 18:45:01
| Show all posts
Oh, thanks. . .
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list