我我今天做了
if messagebox(0,'这个编号‘+dbedit1.text+’已经有了需要覆盖吗?‘,’询问‘,mb_yesno+mb_defbutton)= idyes then
但是这句话有错误。
错误大致是
incompatible type string and pchar
我知道dbedit1.text是指针,但是我不知道怎么表示他们的值在上面的语句中,能给个正确的,最好是验证过的方法吗???
if messagebox(0,'这个编号‘+dbedit1.text+’已经有了需要覆盖吗?‘,’询问‘,mb_yesno+mb_defbutton)= idyes then
但是这句话有错误。
错误大致是
incompatible type string and pchar
我知道dbedit1.text是指针,但是我不知道怎么表示他们的值在上面的语句中,能给个正确的,最好是验证过的方法吗???
没看见
var
str:string;
str:='ddddddddddd'+edit1.text;
if application.messagebox(pchar(str),'询问',mb_yesno+mb_defbutton1)= idyes then
str:string;
brgin
str:='ddddddddddd'+edit1.text;
if application.messagebox(pchar(str),'询问',mb_yesno+mb_defbutton1)= idyes thenend;
……
这种做法一定OK!不行找我!!!
另外,你代码中的"mb_yesno+mb_defbutton"有问题,所以我在此去掉了"+mb_defbutton",一样能实现你要的效果!!!别忘了给我分,我爱delphi,更爱你给分!!哈哈!!!! (^_^)
str:string;
str:='ddddddddddd'+edit1.text;
if application.messagebox(pchar(str),'询问',mb_yesno+mb_defbutton1)= idyes then
messagebox()中的标题参数是pchar类型的!