小弟想在弹出的messagebox对话框中显示edit1.text中的值,该咋办?或者用别的方法实现也行;
var i:integer;
begin 
I:=application.messagebox(‘你输入的值是:xxxx','确定输入值’,mb_yesno);
if i=7 then begin
exit;
end
else begin
…………
…………
…………
end;

解决方案 »

  1.   

    var i:integer;
        ss:string;
    begin 
    ss:='你输入的值是:'+edit1.text;
    I:=application.messagebox(ss,'确定输入值’,mb_yesno);
    if i=7 then begin
    exit;
    end
    else begin
    …………
    …………
    …………
    end;
      

  2.   

    n.messagebox(‘你输入的值是:'+Edit1.Text,'确定输入值’,mb_yesno);
      

  3.   

    谢谢大家哈。
    不过可惜还是不行的嘛,第一个错误为:
    ……incompatible types:'string'and'PAnsiChar'
    ……missing operator or semicolon
    ……incompatible types:'procedure,untyped pointer or untyped parameter' and'PAnsichar'
    ……could not compile used unit 'unit1.pas'
    第二个错误为:
    [Error] Unit1.pas(32): Incompatible types: 'String' and 'PAnsiChar'
    [Error] Unit1.pas(33): Missing operator or semicolon
    [Error] Unit1.pas(38): Incompatible types: 'procedure, untyped pointer or untyped parameter' and 'PAnsiChar'
    [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
      

  4.   

    强制类型转换呗...
    ss:='你输入的值是:'+edit1.text;
    I:=application.messagebox(pchar(ss),'确定输入值’,mb_yesno);
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    var i:integer;
    begin
    I:=application.messagebox(PChar('你输入的值是:'+Edit1.Text),'确定输入值',mb_yesno);
    if i=7 then begin
    exit;
    end
    end;