关于comboxbox项目的快速问题.. [英] Very quick question on comboxbox items..

查看:95
本文介绍了关于comboxbox项目的快速问题..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




据我所知,这不可能做到,但我想我会很快问,我有

我的组合框中有4个标签,我想将它们添加到包装盒中,并带有数字

" value"然后获取当前所选项的值。我想要

组合框显示文字而不是当然的价值..


标准组合框可以实现吗?


谢谢,

Dan

Hi,

As far as i can tell this can''t be done, but thought i''d quickly ask, I have
4 labels in my combobox, and i want to add them to the box with a numeric
"value" and then get that value of the currently selected item. I want the
combobox to display the text not the value of course..

Is this possible with the standard combobox??

Thanks,
Dan

推荐答案

嗨丹,


同样的问题今天上午10:25 - 我想这是其中之一。 ;-)


将对象分配给组合框而不是单个值。你的覆盖对象'ToString的
将提供显示的文本,但是在代码中访问

项将获得整个对象。


问候,

Fergus
Hi Dan,

Same question at 10:25am today - I guess it''s one of those. ;-)

Assign an object to the combobox rather than a single value. Your override
of the object''s ToString will provide the text for display, but accessing the
Item in code will get the whole object.

Regards,
Fergus


*" Dan Keeley" <毫安******** @ hotmail.com> scripsit:
* "Dan Keeley" <ma********@hotmail.com> scripsit:
据我所知,这不可能做到,但我想我会很快问,我的组合框中有4个标签,我想添加它们带有数字的价值框。然后获取当前所选项的值。我希望
组合框显示文字而不是当然的价值..
As far as i can tell this can''t be done, but thought i''d quickly ask, I have
4 labels in my combobox, and i want to add them to the box with a numeric
"value" and then get that value of the currently selected item. I want the
combobox to display the text not the value of course..




看看这个讨论:


< http://www.google.de/groups?selm = bme0qq%24loej5%241%40ID-208219.news.uni-berlin.de>


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org/ dotnet>



Have a look at this discussion:

<http://www.google.de/groups?selm=bme0qq%24loej5%241%40ID-208219.news.uni-berlin.de>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


>
看看这个讨论:


< http:// www。 google.de/groups?selm=bme...19.news.uni-be

rlin.de>
-
Herfried K. Wagner
MVP·VB Classic,VB.NET
< http://www.mvps.org/dotnet>
Have a look at this discussion:

<http://www.google.de/groups?selm=bme...19.news.uni-be
rlin.de>
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>




非常感谢两者那些非常快速的回复!!


Rgds,

Dan



Excellent thanks for both of those very quick replies!!

Rgds,
Dan


这篇关于关于comboxbox项目的快速问题..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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