那个mb_OKCancel,怎么能和mbinformation,一块都显示出来?

解决方案 »

  1.   

    case Application.MessageBox('提示', '标题', MB_YESNOCANCEL + MB_ICONINFORMATION) of
        IDYES: Application.MessageBox('你选择了[YES]', '标题', MB_OK + MB_ICONINFORMATION);
        IDNO:Application.MessageBox('你选择了[NO]', '标题', MB_OK + MB_ICONINFORMATION);
        IDCANCEL:Application.MessageBox('你选择了[CANCEL]', '标题', MB_OK + MB_ICONINFORMATION);
      end;
      

  2.   

    //感觉接不到一块....
    MB_ABORTRETRYIGNORE The message box contains three push buttons: Abort, Retry, and Ignore.
    MB_OK The message box contains one push button: OK. This is the default.
    MB_OKCANCEL The message box contains two push buttons: OK and Cancel.
    MB_RETRYCANCEL The message box contains two push buttons: Retry and Cancel.
    MB_YESNO The message box contains two push buttons: Yes and No.
    MB_YESNOCANCEL The message box contains three push buttons: Yes, No, and Cancel.MessageBox returns 0 if there isn抰 enough memory to create the message box. Otherwise it returns one of the following values:
      

  3.   

    Application.MessageBox('haha','klaksd',MB_OKCANCEL +MB_ICONINFORMATION);
      

  4.   

    int MessageBox(
    HWND hWnd, 
    LPCTSTR lpText, 
    LPCTSTR lpCaption, 
    UINT uType);
      

  5.   


    if Application.MessageBox('正文','标题',MB_yesno + MB_DEFBUTTON1)=mryes then
     Application.MessageBox('正文','标题',MB_OKCANCEL + MB_DEFBUTTON1); //无图(确定,取消)
     application.messagebox('正文','标题',mb_ok+mb_iconinformation); //i号(确定)
     application.messagebox('正文','标题',mb_yesno+mb_iconerror);   //叉号(是,否)
     application.messagebox('正文','标题',mb_ok+mb_iconexclamation); //叹号(确定)
     application.messagebox('正文','标题',mb_yesnoCANCEL+mb_iconquestion);  //问号(是,否,取消)
     application.messagebox(pchar('正文'),'标题',mb_ok+MB_iconinformation); //如果有变量字符串,可用'pchar'强行转换//按钮方式或返回值:mbyes,mbno,mbok,mbcancel,mbhelp,mbabort,
    //mbretry,mbignore,mball,mbnotoall,mbyestoall,mbabort,mbretry,mbignore
    Value MeaningMB_ABORTRETRYIGNORE The message box contains three push buttons: Abort, Retry, and Ignore.
    MB_OK The message box contains one push button: OK. This is the default.
    MB_OKCANCEL The message box contains two push buttons: OK and Cancel.
    MB_RETRYCANCEL The message box contains two push buttons: Retry and Cancel.
    MB_YESNO The message box contains two push buttons: Yes and No.
    MB_YESNOCANCEL The message box contains three push buttons: Yes, No, and Cancel.
    Value Numeric value MeaningIDOK 1 The user chose the OK button.
    IDCANCEL2 The user chose the Cancel button.
    IDABORT 3 The user chose the Abort button.
    IDRETRY 4 The user chose the Retry button.
    IDIGNORE5 The user chose the Ignore button.
    IDYES 6 The user chose the Yes button.
    IDNO 7 The user chose the No button.
      

  6.   

    http://denguo.com/forumTopicRead.asp?id=16&ntime=2005%2D3%2D17+10%3A26%3A55Application.MessageBox 是 TApplication 的成员函数,宣告如下:
    function TApplication.MessageBox(const Text, Caption: PChar; Flags: Longint): Integer;引数:
     1. Text:要显示的讯息
     2. Caption:讯息视窗的标题列文字
     3. Flags:讯息旗标
        3.1. 可指定讯息视窗上的图示
        3.2. 可指定讯息视窗出现的按钮
        3.3. 可指定预设Focus在哪一个按钮
        3.4. 可指定是否 Modal
        3.5. 其他引数说明:
    Text、Caption 引数为 PCahr 型态,字串型态的变数可用 PChar()
    转换,若直接传入一个字串的话,就不用转型。
    例如:
    var s: string;
    ....
    s := '存档失败';
    Application.MessageBox(PChar(s), '错误', MB_ICONERROR);Flag 引数为 Longint 型态,可用的传入值有:
    1. 指定讯息视窗上的图示
     1.1 MB_ICONEXCLAMATION 或 MB_ICONWARNING
         出现「黄三角形内有一个惊叹号」图示
     1.2 MB_ICONINFORMATION 或 MB_ICONASTERISK
         出现「白色椭圆内有一个蓝色小写 i」图示
     1.3 MB_ICONQUESTION
         出现「问号」图示
     1.4 MB_ICONSTOP 或 MB_ICONERROR 或 MB_ICONHAND
         出现「红色X」图示2. 指定讯息视窗出现的按钮
     2.1 MB_ABORTRETRYIGNORE
         出现「Abort」「Retry」「Ignore」三个按钮
     2.2 MB_OK
         出现「Ok」按钮,为预设值。
     2.3 MB_OKCANCEL
         出现「Ok」「Cancel」两个按钮
     2.4 MB_RETRYCANCEL
         出现「Retry」「Cancel」两个按钮
     2.5 MB_YESNO
         出现「Yes」「No」两个按钮
     2.6 MB_YESNOCANCEL
         出现「Yes」「No」「Cancel」三个按钮3. 可指定预设Focus在哪一个按钮
     3.1 MB_DEFBUTTON1
         指定focus在左边第一个按钮,这是预设值。
     3.2 MB_DEFBUTTON2、MB_DEFBUTTON3、MB_DEFBUTTON4
         以此类推,指定focus在左边第二、三、四个按钮4. 可指定是否 Modal
     4.1 MB_APPLMODAL
         对于应用程式而言,是 modal form
     4.2 MB_SYSTEMMODAL
         对于作业系统而言,是 modal form
     4.3 MB_TASKMODAL
         对于 task 而言,是 modal form
         一般来说,这跟 MB_APPLMODAL 是等效的,但是当应用程式中的所有
        form 都隐藏的时候,就必须使用这个,才能达到 modal 的目的5. 其他
     5.1 MB_TOPMOST
         将讯息视窗提至最前面
     5.2 MB_RIGHT
         将讯息文字向右对齐在一个 Flag 要指定这么多的东西,要如何使用呢?
    只要把要用的引数组合 or 起来就可以了。例如:Application.MessageBox(PCahr(sMsg), PChar(sCap), MB_YESNO or MB_ICONQUESTION or MB_DEFBUTTON2)
    这样会出现「问号」图示,「Yes」「No」两个按钮,而且 focus 在 No 按钮上回传值:
     1. IDABORT:使用者按了「Abort」按钮
     2. IDCANCEL:使用者按了「Cancel」按钮
     3. IDIGNORE:使用者按了「Ignore」按钮
     4. IDNO:使用者按了「No」按钮
     5. IDOK:使用者按了「Ok」按钮
     6. IDRETRY:使用者按了「Retry」按钮
     7. IDYES:使用者按了「Yes」按钮顺带一提,按钮上的文字是会随着作业系统的语系而改变的,用中文版的 Windows,按钮上的文字就出现中文。
      

  7.   

    呵~`跟VB用法差不多
    学习ing...