gpt4 book ai didi

c++ - 如何在 RAD Studio XE 中更改 TMsgDlgButtons "Yes"和 "No"按钮的文本?

转载 作者:行者123 更新时间:2023-11-28 05:00:15 24 4
gpt4 key购买 nike

我想更改消息框中 YESNO 按钮的文本。

CModalWndManager::ShowMessageBox(AnsiString::LoadStr(IDS_NOT_SUPPORTED).c_str(), mtWarning, TMsgDlgButtons() << mbYes << mbNo, mbOK == mrYes);

我想要"Switch Mode",而不是YES,对于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

关于c++ - 如何在 RAD Studio XE 中更改 TMsgDlgButtons "Yes"和 "No"按钮的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46211904/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com