ShowMessage(const Msg:String); ShowMessage只有确定按钮。 如果你想在返回值时打开或不打开窗口的话,就使用MessageBox函数。 MessageBox(Text,Caption,Flages); 如: var ret:=integer begin ret:=application.MessageBox('你好,Delphi','delphi世界',mb_iconinformation+mb_okcancel+mb_defbutton1); if ret=1 then {1表示OK的返回值} Form1.show; else Form2.show;
if Application.MessageBox('Yes or NO?','请选择',MB_YESNO + MB_ICONQUESTION ) = IDNO then ... else ...;
ShowMessage只有确定按钮。
如果你想在返回值时打开或不打开窗口的话,就使用MessageBox函数。
MessageBox(Text,Caption,Flages);
如:
var
ret:=integer
begin
ret:=application.MessageBox('你好,Delphi','delphi世界',mb_iconinformation+mb_okcancel+mb_defbutton1);
if ret=1 then {1表示OK的返回值}
Form1.show;
else
Form2.show;
...
else
...;