那你在你的bitbnt内的代码中把close;这句去掉啊

解决方案 »

  1.   

    我明白了,你是设了Kind属性,不要设这个,很烦人的,要不就用回button算了
      

  2.   

    BitBnt.Cancel := false;
    BitBnt.Kind := bkCustom;
    BitBnt.ModalResult := mrNone;
      

  3.   

    我没有写close 啊。
    kind属性改成什么呢?这是代码
    procedure Tgetmoney.BitBtn2Click(Sender: TObject);
    var
     goodsid,goodsname:string;
    var
     number:integer;
    var
     lingshoujia:currency;
    begin
    with gouwuquery do
        begin
        gouwuquery.close;
        sql.clear;
        SQL.Add('select 商品ID, 商品名, 零售价');
        sql.add('from vgoodsinfo.db where 商品ID=:var1');
        params[0].Asstring:=edit1.text;
        try
            open;
            if gouwuquery.RecordCount=1  then
            begin
            goodsid:=gouwuQuery.FieldByName('商品ID').Value;
            goodsname:=gouwuQuery.FieldByName('商品名').Value;
            lingshoujia:=gouwuQuery.FieldByName('零售价').Value;
            edit3.Text:=goodsid ;
             number:=strtoint(edit2.Text);
            sum:=sum+number*lingshoujia;        end;
        except
          Application.MessageBox('连接数据库失败','系统提示',mb_ok);
          Application.Terminate;
        end;
        with gouwutable do
        begin
          gouwutable.Append;
          gouwutable.FieldValues['商品ID']:=goodsid;
          gouwutable.FieldValues['商品名']:=goodsname;
          gouwutable.FieldValues['零售价']:=lingshoujia;
          gouwutable.FieldValues['数量']:=number;
         end;end;
    if gouwuquery.RecordCount=0 then
    begin    Application.MessageBox('商品ID有误','系统提示',mb_ok);    Edit1.SetFocus;
        exit;
    end;    end;
      

  4.   

    我将BitBnt.Kind := bkCustom
    问题解决了,谢谢大家。
    结贴。