LinkLabel.LinkCollection 类

表示 LinkLabel 控件内链接的集合。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Class LinkCollection
    Implements IList, ICollection, IEnumerable
用法
Dim instance As LinkCollection
public class LinkCollection : IList, ICollection, IEnumerable
public ref class LinkCollection : IList, ICollection, IEnumerable
public class LinkCollection implements IList, ICollection, 
    IEnumerable
public class LinkCollection implements IList, ICollection, 
    IEnumerable

备注

LinkLabel.LinkCollection 类存储显示在 LinkLabel 控件中的链接。该集合中的每个项都是 LinkLabel.Link 类的一个实例,该实例定义链接的信息。

Add 方法提供向集合中添加单个 LinkLabel.Link 的能力。若要移除链接,可使用 Remove 方法,或者如果知道链接在集合内的位置,则可使用 RemoveAt 方法。Clear 方法使您得以从集合中移除所有链接,而不必使用 Remove 方法一次移除一个链接。

除了添加项和移除项的方法和属性以外,LinkLabel.LinkCollection 还提供在集合内查找链接的方法。Contains 方法使您可以确定某 LinkLabel.Link 是否为集合的成员。在知道链接位于集合中后,可以使用 IndexOf 方法确定链接在集合中的位置。

继承层次结构

System.Object
  System.Windows.Forms.LinkLabel.LinkCollection

线程安全

此类型的任何公共静态(Visual Basic 中的 Shared)成员都是线程安全的,但不保证所有实例成员都是线程安全的。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

LinkLabel.LinkCollection 成员
System.Windows.Forms 命名空间