combobox1.items.count
combobox1.items[序号]
就可以了
combobox1.items[序号]
就可以了
解决方案 »
- DataPreviewForm裡放置了一個QuickRep,怎樣在關閉QuickRep的Preview時同時關閉DataPreviewForm?
- 急!每打印一页就下偏2CM,打N篇就下偏N*2CM
- 数据集问题
- delphi怎么判断sql server数据库的服务启动
- delphi读取内存地址,有经验的大叔来看看
- 请问如何用TTable来实现用sql语句选取部分字段的功能?
- 请教TStringList查重问题
- summernightrain(夏夜雨),请来拿分!
- 这样的线程声明对吗????
- 有关TDadaSet类的问题,请多多指教
- 请问哪位用Delphi 做过mail 和 传真 系统的?一定给我点建议,谢谢!急!
- 怎样彻底删除已作删除标记的数据库记录?
TFORM.COMPOMENTCOUNT可获得所有的控件数量,但如何判断那些是COMBOBOX呢??
for I := 0 to ComboBox1.Items.Conut - 1 do
begin
StringValue := ComboBox1.Items[I];
StringValue := StringValue + IntToStr(I) + ComboBox1.Items[I];
end;
begin
if Form1.Components[I] is TComboBox then
Inc(J);
end;
begin
if (Components[i] is TComboBox) then
……
end;
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;
begin
count:=0;
for i:=0 to form.componentcount-1 do
begin
if (form.components[i] is tcombobox ) then
inc(count);
end;
end;
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;