Link to home
Start Free TrialLog in
Avatar of marb
marb

asked on

Change title (caption) of CDialog at runtime

Hi,

how can I change the caption of my CDialog instance at runtime?

Thank you in advance...
Martin
Avatar of Axter
Axter
Flag of United States of America image

Hi marb,
Call SetWindowText

David Maisonave :-)
Cheers!
Avatar of marb
marb

ASKER

NoteDialog is the name of my dialog class.

When a button is clicked, I wan't to open the dialog. I did like this:

NoteDialog dlg;
dlg.DoModal();

This works, but if I add the line

NoteDialog dlg;
dlg.SetWindowText("Note1");
dlg.DoModal();

The app crashes!
Add the code to your OnInitDialog method in your Dialog class.
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of marb

ASKER

It works...

Thank you Axter for your immidiate answer. It's great to have people like you on Experts Exchange!

Martin