Windows应用程序中带有Combobox项的foreach [英] foreach with Combobox item in windows application

查看:85
本文介绍了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屋!

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