| |

VerySource

 Forgot password?
 Register
Search
View: 1008|Reply: 6

How to display characters line by line in Edit box in MFC

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-10 20:30:01
| Show all posts |Read mode
It is similar to the chat history, each time a new message is sent, a new line is connected after the original character, how to achieve
Reply

Use magic Report

0

Threads

70

Posts

42.00

Credits

Newbie

Rank: 1

Credits
42.00

 China

Post time: 2020-4-5 09:30:01
| Show all posts
Add / r / n at the end of each line to see
Reply

Use magic Report

0

Threads

20

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-4-5 10:15:02
| Show all posts
CString str = "Message string obtained by\n";
m_edit1.SetSel (-1, -1);
m_edit1.ReplaceSel (str);
Reply

Use magic Report

0

Threads

70

Posts

42.00

Credits

Newbie

Rank: 1

Credits
42.00

 China

Post time: 2020-4-5 14:00:01
| Show all posts
E.g

GetDlgItem (IDC_EDIT1)-> SetWindowText ("hello\r\nddd");
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-4-5 22:45:01
| Show all posts
Upstairs positive solution At the same time, pay attention to set the MutiLine in the EDIT control properties to TRUE
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-4-18 18:30:01
| Show all posts
The request of the landlord seems to be added on a new line in the back, (CEdit *) GetDlgItem (IDC_EDIT)-> SetWindowText () is to replace the content of edit.

feel
// CString str = "Message string obtained by\n";
//m_edit1.SetSel(-1, -1);
//m_edit1.ReplaceSel(str);
Yes
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-8-12 01:30:01
| Show all posts
question is still
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