在DELPHI中如何使用“消息对话框”(类似于VB中Msgbox)的功能? 在DELPHI中如何使用“消息对话框”(类似于VB中Msgbox)的功能? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Application.MessageBox(const Text, Caption: PChar; Flags: Longint);ShowMessage('');MessageDlg('', mtXXXX, [mbOK, ...], 0); messagebox();showmessage();messagedlg(); 都能实现呀例如 showmessage('消息对话框');messagebox('TitleName','消息对话框',MB_ICONERROR or MB_Ok);MessageDlg('Exiting the Object Pascal application.', mtInformation, [mbOk], 0);具体的看帮助吧 1.procedure ShowMessage(const Msg: string);2.function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word; procedure TForm1.Button1Click(Sender: TObject);begin if MessageDlg('Welcome to my Object Pascal application. Exit now?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin MessageDlg('Exiting the Object Pascal application.', mtInformation, [mbOk], 0); Close; end;end;3.function MessageBox(const Text, Caption: PChar; Flags: Longint): Integer; if Application.MessageBox( 'Could not open Table1 exclusively - Try again?', 'Open Error', MB_OKCANCEL + MB_DEFBUTTON1) <> IDOK then raise; 看看帮助吧! messagebox();showmessage();messagedlg(); 都能实现具体的可以f1 messagebox();showmessage();messagedlg(); 都能实现呀例如 showmessage('消息对话框');messagebox('TitleName','消息对话框',MB_ICONERROR or MB_Ok);MessageDlg('Exiting the Object Pascal application.', mtInformation,[mbOk], 0);哪一个都是可以的 application.messagebox('信息','標題',[圖標]+[按鈕]);如:if application.MessageBox('信息。','標題',mb_iconinformation+MB_YesNo)=mrYesthen showmessage('你選擇了是!');圖標常用的有:mb_iconInformation :信息mb_iconQuestion :提問mb_iconWarning :警告mb_iconError :錯誤按鈕常用的有:mb_YesNomb_OkCancel 其实只是使用方法不同罢了!不过我最喜欢用messageboxif application.MessageBox('ssssss','message',mb_iconinformation+MB_YesNo)=mrYesthen showmessage('true!'); IF MessageDlg('True?',mtConfirmation, [mbYes, mbNo], 0)=mrYes then showmessage('True!')else showmessage('False!'); 请问ini文件怎么逐一对比。。 请教 OpenGL 如何用已知点画连续的线? 给定字符串固定区域内换行问题 richedit里怎么判断选择了文本,撤选了文本?? 如何在进度条中显示文本? delphi7为何不支持null呢? 有关在STINGRID中更改颜色的问题 Kingron主页更新中......... 在组件的属性栏中属性输入错误后,会有提示出现并恢复原来的值?如果实现。 失望!失望!我都贴了N次帖子,还是没人能回答!“NT Service型的MIDAS应用” 如果判断屏幕的大小,即分辨率 怎么安装QReport控件?
ShowMessage('');
MessageDlg('', mtXXXX, [mbOK, ...], 0);
showmessage();
messagedlg(); 都能实现呀
例如 showmessage('消息对话框');
messagebox('TitleName','消息对话框',MB_ICONERROR or MB_Ok);
MessageDlg('Exiting the Object Pascal application.', mtInformation,
[mbOk], 0);
具体的看帮助吧
2.function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons:
TMsgDlgButtons; HelpCtx: Longint): Word;
procedure TForm1.Button1Click(Sender: TObject);begin
if MessageDlg('Welcome to my Object Pascal application. Exit now?',
mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
MessageDlg('Exiting the Object Pascal application.', mtInformation,
[mbOk], 0);
Close;
end;end;
3.function MessageBox(const Text, Caption: PChar; Flags: Longint): Integer;
if Application.MessageBox(
'Could not open Table1 exclusively - Try again?', 'Open Error',
MB_OKCANCEL + MB_DEFBUTTON1) <> IDOK then
raise;
看看帮助吧!
showmessage();
messagedlg(); 都能实现
具体的可以f1
showmessage();
messagedlg(); 都能实现呀
例如 showmessage('消息对话框');
messagebox('TitleName','消息对话框',MB_ICONERROR or MB_Ok);
MessageDlg('Exiting the Object Pascal application.', mtInformation,[mbOk], 0);
哪一个都是可以的
if application.MessageBox('信息。','標題',mb_iconinformation+MB_YesNo)=mrYes
then
showmessage('你選擇了是!');圖標常用的有:
mb_iconInformation :信息
mb_iconQuestion :提問
mb_iconWarning :警告
mb_iconError :錯誤
按鈕常用的有:
mb_YesNo
mb_OkCancel
then
showmessage('true!');
showmessage('True!')
else showmessage('False!');