我想在MessageBox弹出时将一个变量值显示出来,可是系统老提示出错。
我的代码差不多是这样的。
var
i:integer;
begin
i:=12;
application.messagebox('i的值为:'+inttostr(i),'提示',MB_OK+MBICONINFORMATION);
end;可是提示说“string and PAnsiChar”,不能编译通过,这是为什么呢???
我的代码差不多是这样的。
var
i:integer;
begin
i:=12;
application.messagebox('i的值为:'+inttostr(i),'提示',MB_OK+MBICONINFORMATION);
end;可是提示说“string and PAnsiChar”,不能编译通过,这是为什么呢???
Application.MessageBox(PChar('你要'+Edit1.text,'),信息提示',MB_OK+MB_ICONINFORMATION)
messagebox中加入自定义字符串的方法
Application.MessageBox(PChar('i的值为:'+inttostr(i)),‘信息提示',MB_OK+MB_ICONINFORMATION)
function TApplication.MessageBox(const Text, Caption: PChar; Flags: Longint): Integer;所以最好这样写:application.messagebox(pchar('i的值为:'+inttostr(i)),pchar('提示'),MB_OK+MBICONINFORMATION);
Application.MessageBox(PChar('i的值为:'+inttostr(i)),‘信息提示',MB_OK+MB_ICONINFORMATION)