在ListBox中显示对象 [英] Displaying objects in a ListBox

查看:52
本文介绍了在ListBox中显示对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ListBox控件中,我想显示从List< T>派生的对象。这些对象具有被覆盖的"ToString()"。方法。列表框然而显示"(Sammlung)"。对于我添加的每个对象。如何强制ListBox显示由ToString()生成的
字符串?

In a ListBox control I want to display objects derived from List<T>. These objects have an overridden "ToString()" Method. The ListBox however shows "(Sammlung)" for each object I add. How can I force the ListBox to display the string resulting from ToString()?

推荐答案

尝试将列表框的
FormattingEnabled 属性设置为错误


这篇关于在ListBox中显示对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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