Zhang
Zhang

Reputation: 3356

Is it possible to add text instead of replacing the entire text for a static text control on MFC?

I know the classic way to show text on a static text control.

GetDlgItem(IDC_STATIC_YOURTEXT)->SetWindowText("What you want to show");

But if my text is gradually added, doesn't have to replace the entire old text. Replacing entire would be low performance if the text is long. Is there any way to add text gradually.

enter image description here

Upvotes: 0

Views: 161

Answers (1)

nvoigt
nvoigt

Reputation: 77364

No, there is no such way. If you want to add to a text, keep your own variable, add to it and then call SetWindowText with your variable again when it changes.

If that is too slow, maybe a static text control is not the best way to achieve your goal.

Upvotes: 1

Related Questions