Delphi 消息窗口 Application.messagebox

1、命名空間:Vcl.Forms

2、Application.MessageBox()中的參數:

      如:Application.MessageBox('當前查找結果爲空,請確認XXXXX!','提示:',mb_ok)
                第一個和第二個都是:PWideChar
                        使用時用到String類型的message_info時可以這樣轉換:PWideChar(WideString(str_Message))
                    message_info := '當前查找結果爲空,請確認XXXXX!';
                        message_type:= '提示:';                       
                        Application.MessageBox(PWideChar(WideString(message_info)),PWideChar(WideString(message_type)),mb_ok)
                第三個參數是窗體上的按鍵類型:     
                        mb_ok:只有確定鍵
                        MB_OKCANCEL : 確定和取消鍵

3、Application.messagebox():返回值。

     點擊確定:返回值爲1(Integer);
         如:
         if(Application.messagebox('確定刪除?', '提示:', MB_OKCANCEL) <> 1)
         begin

         end;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章