应该是messagedlg('hello',mtCustom,[mbYes,mbNo],0);

解决方案 »

  1.   

    同意楼上的
    delphi中删除空格好像也是trim
      

  2.   

    不对呀,我要定义messagebox的caption,而不是Msg。按你的写法,caption为project1(默认的项目名)。
      

  3.   

    Trim functionSee alsoTrims leading and trailing spaces and control characters from a string.UnitSysutilsCategorystring handling routinesfunction Trim(const S: string): string;DescriptionTrim removes leading and trailing spaces and control characters from the given string S.
      

  4.   

    第一个问题tob已经说了呀
    还有,谁说delphi中没trim函数?我就经常用
      

  5.   

    用application.messagedlg可以达到你的要求
    删除空格用trim
      

  6.   

    messagedlg的caption是你工程的名字,要自定义消息框的Caption要用TApplication.MessageBox:
    function MessageBox(const Text, Caption: PChar; Flags: Longint): Integer;
      

  7.   

    如果按照wljcr(不要了吧?)说的话,那delphi的帮助有错误了。请看下面一段,是我从delphi的关于messagedlg帮助中粘贴下来的:
    function MessageDlg(const Caption: WideString; const Msg: WideString; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultBtn: TMsgDlgBtn = mbNone; Bitmap: TBitmap = nil): Integer; overload;
    上面分明可以定义消息框的Caption!!!
      

  8.   

    你看错地方了,如果不用Dialogs单元而用QDialogs的话就可编译。这是Delphi提供的跨平台的函数。