刷新c#中的组合框 [英] refresh combo box in c#
本文介绍了刷新c#中的组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi
我有3个组合框,每个组合框都选择特殊数据。当我按下combobox1时,它有2个物体!一个被选中。根据这个选择,我可以选择与其他人不同的combobox2特殊数据!当我选择其他值的combobox1时,在combobox2上删除了combobox2的值。
i写道:
if (comboBox44.SelectedIndex == 0 )
{
S_DRV_Byte26 =( byte )(S_DRV_Byte26 | 0x00);
comboBox43.Items.RemoveAt( 2 ); comboBox43.Items.RemoveAt( 2 );
}
else
{
S_DRV_Byte26 =( byte )(S_DRV_Byte26& 0xff); comboBox43.Refresh();
}
如何刷新组合框以便从中选择?
解决方案
这是一个解释c#中级联组合框如何工作的链接:
在Winforms中级联ComboBox [ ^ ]
祝你好运,
OI
< blockquote>是的,你可以通过在combobox的selectionCommitedchange上调用第二组代码
hi
i have 3 comboboxes that each of them selects special data. when i press on combobox1, it has 2 object! one is selected. according to this selection, i can select special data on combobox2 that is different with others! when i select on other value of combobox1, the values of combobox2 is deleted on combobox2.
i wrote:
if (comboBox44.SelectedIndex == 0)
{
S_DRV_Byte26 = (byte)(S_DRV_Byte26 | 0x00);
comboBox43.Items.RemoveAt(2); comboBox43.Items.RemoveAt(2);
}
else
{
S_DRV_Byte26 = (byte)(S_DRV_Byte26 & 0xff);comboBox43.Refresh();
}
how can i refresh comboboxes to select from first?
解决方案
Here is a link which explains how cascading combobox in c# works:
Cascading ComboBox In Winforms[^]
Good luck,,
OI
yes you can by calling the second set of code at selectionCommitedchange of combobox
这篇关于刷新c#中的组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文