如何根据另一个组合框的选定值填充组合框 [英] how to populate combobox based on another combobox's selected value

查看:76
本文介绍了如何根据另一个组合框的选定值填充组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个组合框,其中一个基于另一个的选定值,因此如何填充相关的组合框

感谢

I have 2 combobox one of them based on the other''s selected value so how can I populate the dependant combobox

thanks

推荐答案

Hello Hazem,

查看ComboBox的事件SelectedIndexChanged,SelectedValueChanged和属性SelectedItem.因此,当CBA进行选择更改时,您
适当地填充CBB.

填充CB B:

Hello Hazem,

look at ComboBox''s events SelectedIndexChanged, SelectedValueChanged and the property SelectedItem. So when CB A has a selection change you
populate CB B appropriately.

Populating CB B:

comboBox1.Items.Clear();
comboBox1.Items.Add(new Item("Blue", 1));
...
...




干杯

曼弗雷德(Manfred)




Cheers

Manfred


这篇关于如何根据另一个组合框的选定值填充组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆