user3494614
user3494614

Reputation: 603

how to change caption of button present on MFC dialog box

I have a MFC dialog box with small text box and button for ok and cancel. Now in some cases I want to change caption of OK and CANCEL button to YES and NO. Is there a way to do this outside of OnInitdialog method of CDialog class

Thanks Niraj Rathi

Upvotes: 1

Views: 13097

Answers (1)

Wojtek Surowka
Wojtek Surowka

Reputation: 20993

You can change those text at any moment (when the dialog window exists) with SetWindowText function, e.g.:

GetDlgItem(IDOK)->SetWindowText("Yes");

Upvotes: 5

Related Questions