请问showmessage的参数怎么设置的
例如我想如果回答是打开一个窗口,否则打开另一个窗口

解决方案 »

  1.   

    Showmessage没有返回值的,用MessageBox吧
      

  2.   

    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;
      

  3.   

    if Application.MessageBox('Yes or NO?','请选择',MB_YESNO + MB_ICONQUESTION ) = IDNO then
      ...
    else
      ...;
      

  4.   

    MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Word;