C # ComboBox.Items is a property or array?
source link: https://www.codesd.com/item/c-combobox-items-is-a-property-or-array.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
C # ComboBox.Items is a property or array?
This question already has an answer here:
- What is the use of Indexers? 5 answers
Reference to Microsoft Developer Network, ComboBox.Items Property syntax is
public ComboBox.ObjectCollection Items { get; }
It show me that ComboBox.Items
will return an object. And that I can use this object add/remove... method to maintain combobox content
But why I can use ComboBox.Items[index]
array to return value to me for example, ComboBox.Items[0].Text
So, I don't understand items is a property or is a array.
ComboBox.ObjectCollection
is property which has a return type that supports indexing and is collection.
This type implements all these interfaces, which makes it a collection and allows you to do indexing on it.
Public Class ObjectCollection
Implements IList, ICollection, IEnumerable
MSDN Link : https://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.objectcollection(v=vs.110).aspx
Related Articles
Exposing the Combobox Items property in a userc command
Show items in ComboBox based on a property
how to populate combobox in a usercontrol from an array in a class
Disclaimer / Block selection of combobox item disabled in wpf
Iteration on ComboBox.Items securely
Access to ComboBox.Items with the Contains method for DataBound ComboBox
How to get all items with NSPredicate CONTAINS IN array
How to create an array in jQuery plugin property object / array
ComboBox.Item.AddRange (string []) VS. ComboBox.DataSource = string []
Deleting or deactivating the selected ComboBox item in another list
Link ComboBox items to SelectedItem from another Combobox
Wpf combobox item selected by mouse
Default value of ComboBox based on a property
Silverlight combobox item height null
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK