application.MessageBox('确实要退出吗?','提示',mb_iconinformation+mb_yesnocancel);
messagebox提示信息中有3个选项,如何使选者每个选项后分别执行一个不同的操作?

解决方案 »

  1.   

    多加几个MB_,也可以用i:=messagebox(handle,'','',mb_yesno+mb_iconquestion);  i为integer类型,
    等等.参考一下它的参数具体代表什么的~~~~
      

  2.   

    MessageBox returns 0 if there isn't enough memory to create the message box. Otherwise it returns one of the following values:
     
    ValueNumeric valueMeaning
       Value  Numeric value  Meaning 
     IDOK
     1
     The user chose the OK button.
     
     IDCANCEL
     2
     The user chose the Cancel button.
     
     IDABORT
     3
     The user chose the Abort button.
     
     IDRETRY
     4
     The user chose the Retry button.
     
     IDIGNORE
     5
     The user chose the Ignore button.
     
     IDYES
     6
     The user chose the Yes button.
     
     IDNO
     7
     The user chose the No button.
     
      

  3.   

    if application.MessageBox('确实要退出吗?','提示',mb_iconinformation+mb_yesnocancel)=IDYES then
      Showmessage('你选择了是')
      else
      ShowMessage('你选择了否')