combox没有值吗?类似于C# 里combox的 selectedValue属性
就像html的option标签那样 <option value="值">文字</option>
delphi 的combox只有 text吗?
如果有怎样赋值?

解决方案 »

  1.   

    Combobox.text := ''
    下拉
    comBoBox1.Items.Add('')
      

  2.   

    Tcombobox
    1、显示的值为combobox1.text;
    2、隐含的值存在Items项中,它ListString类型,通过comBoBox1.Items.Add('')加入;
    3、选择Items值时,通过下拉对话框。
      

  3.   

    你要隐性的可以保存对应编号什么的,combobox是实现不了的,它只有一个值
      

  4.   

    combox可以AddObject 楼主可以将编码作为Object加入
      

  5.   

    是不是combobox.items[combobox.ItemIndex]
      

  6.   


    //定义类
      TOtherData = class
        BH:string;
        LEVEL:string;
      end;
    //------------------------------------------------------------------------------
    //函数名称: InitCombobox
    //函数功能: 初始化编码选择功能
    //------------------------------------------------------------------------------procedure TDataModule1.InitCombobox(tbname: string; Combobox: TComboBox);
    var otherdata:TOtherData;
        ADOQtemp:TADOQuery;
    begin                                     
      ADOQtemp:=nil;
      try
        ADOQtemp:=TADOQuery.Create(nil);
        ADOQtemp.Connection:=con_Local;
        ADOQtemp.Close;
        ADOQtemp.SQL.Text:='SELECT * FROM '+tbname+' WHERE F_ISDEL=''N''';
        ADOQtemp.Open;
        while not ADOQtemp.Eof do                  
        begin
          otherdata:=TOtherData.Create;
          otherdata.BH:=ADOQtemp.FieldByName('F_BM').AsString;
          Combobox.Items.AddObject(ADOQtemp.FieldByName('F_MC').AsString,otherdata);
          ADOQtemp.Next;
        end;
      finally
        ADOQtemp.Free;
      end;
    end;