LinkLabel::LinkCollection Class
Represents the collection of links within a LinkLabel control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The LinkLabel::LinkCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | LinkLabel::LinkCollection | Initializes a new instance of the LinkLabel::LinkCollection class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of links in the collection. |
![]() | IsReadOnly | Gets a value indicating whether this collection is read-only. |
![]() | Item[Int32] | Gets and sets the link at the specified index within the collection. |
![]() | Item[String] | Gets a link with the specified key from the collection. |
![]() | LinksAdded | Gets a value indicating whether links have been added to the LinkLabel::LinkCollection. |
| Name | Description | |
|---|---|---|
![]() | Add(LinkLabel::Link) | Adds a link with the specified value to the collection. |
![]() | Add(Int32, Int32) | Adds a link to the collection. |
![]() | Add(Int32, Int32, Object) | Adds a link to the collection with information to associate with the link. |
![]() | Clear | Clears all links from the collection. |
![]() | Contains | Determines whether the specified link is within the collection. |
![]() | ContainsKey | Returns a value indicating whether the collection contains a link with the specified key. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetEnumerator | Returns an enumerator to use to iterate through the link collection. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IndexOf | Returns the index of the specified link within the collection. |
![]() | IndexOfKey | Retrieves the zero-based index of the first occurrence of the specified key within the entire collection. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Remove | Removes the specified link from the collection. |
![]() | RemoveAt | Removes a link at a specified location within the collection. |
![]() | RemoveByKey | Removes the link with the specified key. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() | Cast<TResult> | Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection::CopyTo | For a description of this member, see ICollection::CopyTo. |
![]() ![]() | ICollection::IsSynchronized | For a description of this member, see ICollection::IsSynchronized. |
![]() ![]() | ICollection::SyncRoot | For a description of this member, see ICollection::SyncRoot. |
![]() ![]() | IList::Add | For a description of this member, see IList::Add. |
![]() ![]() | IList::Contains | For a description of this member, see IList::Contains. |
![]() ![]() | IList::IndexOf | For a description of this member, see IList::IndexOf. |
![]() ![]() | IList::Insert | For a description of this member, see IList::Insert. |
![]() ![]() | IList::IsFixedSize | For a description of this member, see .IList::IsFixedSize. |
![]() ![]() | IList::Item | For a description of this member, see IList::Item. |
![]() ![]() | IList::Remove | For a description of this member, see IList::Remove. |
The LinkLabel::LinkCollection class stores the link displayed in the LinkLabel control. Each item in the collection is an instance of the LinkLabel::Link class, which defines the information of the link.
The Add method provides the ability to add a single LinkLabel::Link to the collection. To remove links, you can use either the Remove method or the RemoveAt method if you know where the link is located within the collection. The Clear method enables you to remove all links from the collection instead of using the Remove method to remove a single link at a time.
In addition to methods and properties for adding and removing items, the LinkLabel::LinkCollection also provides methods to find links within the collection. The Contains method enables you to determine whether a LinkLabel::Link is a member of the collection. Once you know that the link is located within the collection, you can use the IndexOf method to determine where the link is located within the collection.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

