我我今天做了
if messagebox(0,'这个编号‘+dbedit1.text+’已经有了需要覆盖吗?‘,’询问‘,mb_yesno+mb_defbutton)= idyes then
但是这句话有错误。
错误大致是
incompatible type string and pchar
我知道dbedit1.text是指针,但是我不知道怎么表示他们的值在上面的语句中,能给个正确的,最好是验证过的方法吗???

解决方案 »

  1.   

    还有我有试过pchar(dbedit1.text)但是还是抱错
      

  2.   

    if messagebox('这个编号‘+dbedit1.text+’已经有了需要覆盖吗?‘,’询问‘,mb_yesno+mb_defbutton)= idyes then
      

  3.   

    不好意思发错了 :)
    没看见
    var
    str:string;
    str:='ddddddddddd'+edit1.text;
    if application.messagebox(pchar(str),'询问',mb_yesno+mb_defbutton1)= idyes then
      

  4.   

    var
    str:string;
    brgin
    str:='ddddddddddd'+edit1.text;
    if application.messagebox(pchar(str),'询问',mb_yesno+mb_defbutton1)= idyes thenend;
      

  5.   

    it messagebox(0,pchar('这个编号'+dbedit1.EditText+'已经有了需要覆盖吗?'),'询问',mb_yesno)=idyes then
    ……
    这种做法一定OK!不行找我!!!
    另外,你代码中的"mb_yesno+mb_defbutton"有问题,所以我在此去掉了"+mb_defbutton",一样能实现你要的效果!!!别忘了给我分,我爱delphi,更爱你给分!!哈哈!!!!  (^_^)
      

  6.   

    var
    str:string;
    str:='ddddddddddd'+edit1.text;
    if application.messagebox(pchar(str),'询问',mb_yesno+mb_defbutton1)= idyes then
      

  7.   

    呵呵,晚了晚了!
    messagebox()中的标题参数是pchar类型的!