两个combobox,如果实现过滤 第一个combobox有a,b,c第二个combobox有a1,a2,b1,b2,c1c2怎么让第一个combobox选a,第二个combobox显示a1,a2;选b,显示b1,b2,选c,显示c1,c2? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果是两个表的话.可以使用dbcombobox实现. 不是表,a,b,c,a1都是items. procedure TForm1.ComboBox1Change(Sender: TObject);begin case combobox1.ItemIndex of 0:begin combobox2.Items.Clear; combobox2.Items.Add('a1'); combobox2.Items.Add('a2'); combobox2.ItemIndex:=0; end; 1:begin combobox2.Items.Clear; combobox2.Items.Add('b1'); combobox2.Items.Add('b2'); combobox2.ItemIndex:=0; end; end;end;不知道是不是你想要的。 保留一份combobox2的items的副本,combobox1变化时,遍历items的副本,然后用Pos判断其中是否包含'a',包含的插入到combobox2中 原来要用 add函数 我用了 赋值了~ 菜鸟的问题"开发数据应该程序时,如何设置全局变量" 为什么,我该这么办? string还是长整型? [Borland 年终礼品派送三部曲] 这是那里出的错! 诚邀:Delphi + OpenGL 开发桌面游戏 delphi论谈除了这里,好像没有更好的论谈是吧. 有关报表打印预览问题? 问一个关于Textout的问题 关于制作压缩软件 delphi 运行时编译的问题。。。。。 问一个大家可能很能回答上来的问题,关于webbrowser
begin
case combobox1.ItemIndex of
0:begin
combobox2.Items.Clear;
combobox2.Items.Add('a1');
combobox2.Items.Add('a2');
combobox2.ItemIndex:=0;
end;
1:begin
combobox2.Items.Clear;
combobox2.Items.Add('b1');
combobox2.Items.Add('b2');
combobox2.ItemIndex:=0;
end;
end;
end;
不知道是不是你想要的。