MessageDlg 怎样预设按纽 我知道MessageBox 可以用MB_DefButton进行预设 MessageDlg 怎样设置一触发 焦点在哪个按妞上呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 MessageDlg的按钮参数在Dialogs单元定义,类型是TMsgDlgButtons(注意:不是TMsgDlgButton类型),如下TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp);TMsgDlgButtons = set of TMsgDlgBtn;使用的时候,直接用下面的方式MessageDlg('Exiting the Delphi application.', mtInformation,[mbOk], 0, mbOk);由于是集合类型的参数,所以必须用方括号进行围注! MessageDlg的按钮参数在Dialogs单元定义,类型是TMsgDlgButtons(注意:不是TMsgDlgButton类型),如下TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp);TMsgDlgButtons = set of TMsgDlgBtn;使用的时候,直接用下面的方式MessageDlg('Exiting the Delphi application.', mtInformation,[mbOk], 0, mbOk);由于是集合类型的参数,所以必须用方括号进行围注! TMsgDlgBtn Value Corresponding return valuembOk mrOkmbCancel mrCancelmbYes mrYesmbNo mrNombAbort mrAbortmbRetry mrRetrymbIgnore mrIgnore具体可以看帮助,有例子 function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;function MessageDlg(const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Button1, Button2, Button3: TMsgDlgBtn; HelpCtx: Longint; X, Y: Integer; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload; 我是想一触发MESSAGEDLG 就让焦点固定在一个按纽上 现在MESSAGEDLG默认在最前面的按纽上 MessageDlg('Welcome to my Delphi application. Exit now?', mtConfirmation, [mbYes, mbNo], 0, mbno) = mrYes then close; MessageDlg('WWWW',mtConfirmation, [OK], 0); to tigsin() MessageDlg('Welcome to my Delphi application. Exit now?', mtConfirmation, [mbYes, mbNo], 0, mbno) = mrYes then close;你编译有问题? if MessageDlg('Welcome to my Delphi application. Exit now?', mtConfirmation, [mbYes, mbNo], 0, mbno) = mrYes then close; delphi 7 点击cxgrid后 新增数据时报错? 如何改变IP地址 关于ClientDataSet保存数据的问题? 各位大虾们,偶碰到有个很郁闷的问题啊! 关于query的小问题 delphi消息处理问题 硬盘的标识性符号的的获取 wav/mp3分割合并 还是dbcombobox的问题? 关于信号量的使用问题? 怎么使listbox 和 DBGrid 指定的行用自己喜欢的颜色显示? CORBA高高手请进:如何实现Java与Delphi的CORBA互联?
TMsgDlgButtons = set of TMsgDlgBtn;使用的时候,直接用下面的方式MessageDlg('Exiting the Delphi application.', mtInformation,[mbOk], 0, mbOk);
由于是集合类型的参数,所以必须用方括号进行围注!
TMsgDlgButtons = set of TMsgDlgBtn;使用的时候,直接用下面的方式MessageDlg('Exiting the Delphi application.', mtInformation,[mbOk], 0, mbOk);
由于是集合类型的参数,所以必须用方括号进行围注!
mbCancel mrCancel
mbYes mrYes
mbNo mrNo
mbAbort mrAbort
mbRetry mrRetry
mbIgnore mrIgnore具体可以看帮助,有例子
function MessageDlg(const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;
function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Button1, Button2, Button3: TMsgDlgBtn; HelpCtx: Longint; X, Y: Integer; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;
mtConfirmation, [mbYes, mbNo], 0, mbno) = mrYes then close;
MessageDlg('Welcome to my Delphi application. Exit now?',
mtConfirmation, [mbYes, mbNo], 0, mbno) = mrYes then close;你编译有问题?
mtConfirmation, [mbYes, mbNo], 0, mbno) = mrYes then close;