Windows应用程序中带有Combobox项的foreach [英] foreach with Combobox item in windows application
本文介绍了Windows应用程序中带有Combobox项的foreach的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在winfrom中使用for或foreach获得组合框列表项Display Member和Value Member,我是如何做到的plz帮助我
Hi,
I need to get combobox list Item Display Member and Value Member using for or foreach in winfrom how i did that plz help me
推荐答案
foreach (object o in myComboBox.Items)
{
...
}
取决于您使用的对象放入组合框,将o
转换为适当的类型.
Depending on what objects you put into the combobox, cast o
to the appropriate type.
这篇关于Windows应用程序中带有Combobox项的foreach的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文