我想在消息框中更改YES
和NO
按钮的文本。
CModalWndManager::ShowMessageBox(AnsiString::LoadStr(IDS_NOT_SUPPORTED).c_str(), mtWarning, TMsgDlgButtons() << mbYes << mbNo, mbOK == mrYes);
我需要
YES
而不是"Switch Mode"
,对于NO
我要"Exit"
。在RAD Studio XE中可以这样做吗?
最佳答案
http://bcbjournal.org/articles/vol4/0003/Making_marvelous_message_dialogs.htm
TForm* Dlg = CreateMessageDialog(
"Purge Warp Core?", mtConfirmation,
TMsgDlgButtons() << mbYes << mbNo);
TButton* yb = dynamic_cast<TButton *>
(Dlg->FindComponent("Yes"));
if (yb)
yb->Caption = "Affirmative";
TButton* nb = dynamic_cast<TButton *>
(Dlg->FindComponent("No"));
if (nb)
nb->Caption = "Negative";
int Rslt = Dlg->ShowModal();
switch (Rslt) {
case mrYes: ;// do "Yes" stuff
case mrNo: ;// do "No" stuff