combobox1.items.count
combobox1.items[序号]
就可以了

解决方案 »

  1.   

    我现在最想获得的是如何在一FORM上判断出combobox的个数!!!如何获取COMBOBOX中的值已了解!
    TFORM.COMPOMENTCOUNT可获得所有的控件数量,但如何判断那些是COMBOBOX呢??
      

  2.   

    ComboBox1.Items.Count;
    for I := 0 to ComboBox1.Items.Conut - 1 do 
    begin
      
      StringValue := ComboBox1.Items[I];
      StringValue := StringValue + IntToStr(I) + ComboBox1.Items[I];
    end;
      

  3.   

    for I := 0 to Form1.Components.Count - 1 do 
    begin
      if Form1.Components[I] is TComboBox then
      Inc(J);
    end;
      

  4.   

    for i := 0 to ComponentCount - 1 do
      begin
        if (Components[i] is TComboBox) then
          ……
      end;
      

  5.   

    var
      ii,kk: Integer;
    begin
      kk := 0;
      for ii := 0 to Form1.ComponentCount-1 do
      begin
        if Form1.Components[ii] is TComboBox then
          Inc(kk);
      end;
      ShowMessage(IntToStr(kk));
    end;
      

  6.   

    var i,count:integer;
    begin
      count:=0;
      for i:=0 to form.componentcount-1 do
      begin
        if (form.components[i] is tcombobox ) then
         inc(count);
      end; 
    end;
      

  7.   

    在panel1上创建的COMBOBOX,cc是COMBOBOX的个数
    var
    i,cc:integer;
    classref:Tcontrol;
    conname:string;
    begin
    cc:=0;
    for i:=0 to panel1.ControlCount-1 do
       begin
       classref:=panel1.Controls[i];
       conname:=classref.GetNamePath;
         if copy(conname,1,8)='ComboBox' then  cc:=cc+1;
       end;