[英]How to change the Text of TMsgDlgButtons “Yes” and “No” Buttons in RAD Studio XE?
I want to change the Text of YES
and NO
buttons in a message box. 我想在消息框中更改“是YES
和“ NO
YES
的文本按钮。
CModalWndManager::ShowMessageBox(AnsiString::LoadStr(IDS_NOT_SUPPORTED).c_str(), mtWarning, TMsgDlgButtons() << mbYes << mbNo, mbOK == mrYes);
Instead of YES
, I want "Switch Mode"
, and for NO
I want "Exit"
. 取而代之的YES
,我想"Switch Mode"
,并为NO
我想"Exit"
。
Is it possible to do this in RAD Studio XE? 在RAD Studio XE中可以这样做吗?
http://bcbjournal.org/articles/vol4/0003/Making_marvelous_message_dialogs.htm 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.