中国开发网: 论坛: 程序员情感CBD: 贴子 84578
李颖
数据对象和显示文字的转换关系在这里
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscomboboxobjectcollectionclassaddtopic.asp


.NET Framework Class Library

ComboBox.ObjectCollection.Add Method


Adds an item to the list of items for a ComboBox.

[C#]
public int Add(
object item
);

Parameters
item
An object representing the item to add to the collection.


Remarks

A visual representation of the item is displayed in the combo box. This content representation is specified by the DisplayMember property. If the DisplayMember property is a null reference (Nothing in Visual Basic), the item's ToString method is called to obtain the string that is displayed in the combo box; otherwise, the property of the stored object as specified by the DisplayMember property is displayed.





DisplayMember 说明如下

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformslistcontrolclassdisplaymembertopic.asp

.NET Framework Class Library

ListControl.DisplayMember Property

[C#]
public string DisplayMember {get; set;}


Remarks
The controls that inherit from ListControl can display diverse types of objects. If the specified property does not exist on the object or the value of DisplayMember is an empty string (""), the results of the object's ToString method are displayed instead.



再次鄙视不看帮助的
DISSENT IS THE HIGHEST FORM OF PATRIOTISM !

--Thomas Jefferson

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录