1,用一个comboboX 例出表中的一个字段,我想在combox中输入,进行模糊查询,添加 ,在key up 后让它dropdown可是当下拉后,光标只在第一个?输入总是在第一个?
2,当选取之后,重新加入表中所有字段值后,combobox1.text 却为空?不能为刚选取的字段值?

解决方案 »

  1.   

    是这样啊,我用combobox1 列出表中一个字段,想在输入时模糊找出再加到这 个combobox1 中去!可是,我让它自动下拉后,光标不在最后!
      

  2.   

    inherited;
      if trim(combobox1.Text)<>'' then
      with md do
      begin
        
        {adogoods.First;
        combobox1.Items.Clear;
        while not adogoods.Eof do
        begin
        combobox1.Items.Add(adogoods.FieldValues['goodsname']);
         adogoods.Next;
       end; }
        adogoods.Locate('goodsname',combobox1.text,[loPartialKey]);
        adopos.Close;
           adopos.SQL.Clear;
           adopos.SQL.add('select top 1 * from T_goods where goodsname='''+combobox1.Text  +'''');
           adopos.Open;
         adoquery1.close  ;
        adoquery1.SQL.Clear;
        if radiobutton1.Checked then
        adoquery1.SQL.Add('select * from T_goods where number=-1')
       else
        adoquery1.SQL.Add('select * from T_goods where number<>-1');
        adoquery1.Open;
        adoquery1.First;
        combobox1.Items.Clear ;
        while not adoquery1.Eof do
        begin
         combobox1.Items.Add(adoquery1.FieldValues ['goodsname']);
         adoquery1.Next;
        end;
       // combobox1.Text :=adogoods.FieldValues ['goodsname'];
        end;
      

  3.   

    rikky(读书、心知、生活) 
    你这样光标只是在第二个了!
      

  4.   

    在key up ...
    ?
    什么意思,你在响应事件里写了什么没有...不太懂你的意思