KeysCollection Class
Provides a collection of Keys values.
public class KeysCollection : CollectionBase
- Inheritance:
- object CollectionBase object
Constructors
KeysCollection()
Initializes an instance of the class.
public KeysCollection()
Properties
this[int]
Gets or sets the Keys at the specified index.
[C#] In C#, this property is the indexer for the KeysCollection
class.
public Keys this[int index] { get; }
Parameter | Type | Description |
---|---|---|
index | int | The index of the Keys to return. |
Property Value
Methods
Add(Keys)
Adds a Keys to the end of the collection.
public int Add(Keys value)
Parameter | Type | Description |
---|---|---|
value | Keys | The Keys to be added to the end of the collection. |
Returns
Contains(Keys)
Returns whether the specified Keys is in the collection.
public virtual bool Contains(Keys value)
Parameter | Type | Description |
---|---|---|
value | Keys | The Keys to locate in the collection. |
Returns
IndexOf(Keys)
Searches for the specified Keys and returns the zero-based index of the first occurrence within the entire collection.
public virtual int IndexOf(Keys value)
Parameter | Type | Description |
---|---|---|
value | Keys | The Keys to locate in the collection. |
Returns
Remove(Keys)
Removes the first occurrence of a specific Keys from the collection.
public void Remove(Keys value)
Parameter | Type | Description |
---|---|---|
value | Keys | The Keys to remove from the collection. |
Remarks
The elements that follow the removed element move up to occupy the vacated spot. The indexes of the elements that are moved are also updated.