Displays a single column header in a ListView control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Thetype exposes the following members.
|CanRaiseEvents||Gets a value indicating whether the component can raise an event. (Inherited from Component.)|
|Container||Gets the IContainer that contains the Component. (Inherited from Component.)|
|DesignMode||Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)|
|DisplayIndex||Gets or sets the display order of the column relative to the currently displayed columns.|
|Events||Gets the list of event handlers that are attached to this Component. (Inherited from Component.)|
|ImageIndex||Gets or sets the index of the image displayed in the .|
|ImageKey||Gets or sets the key of the image displayed in the column.|
|ImageList||Gets the image list associated with the .|
|Index||Gets the location with the ListView control's ListView.ColumnHeaderCollection of this column.|
|ListView||Gets the ListView control the is located in.|
|Name||Gets or sets the name of the .|
|Site||Gets or sets the ISite of the Component. (Inherited from Component.)|
|Tag||Gets or sets an object that contains data to associate with the .|
|Text||Gets or sets the text displayed in the column header.|
|TextAlign||Gets or sets the horizontal alignment of the text displayed in the .|
|Width||Gets or sets the width of the column.|
|AutoResize||Resizes the width of the column as indicated by the resize style.|
|Clone||Creates an identical copy of the current that is not attached to any list view control.|
|CreateObjRef||Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)|
|Dispose()||Releases all resources used by the Component. (Inherited from Component.)|
|Dispose(Boolean)||Disposes of the resources (other than memory) used by the . (Overrides Component.Dispose(Boolean).)|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetLifetimeService||Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)|
|GetService||Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|InitializeLifetimeService||Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)|
|MemberwiseClone()||Creates a shallow copy of the current Object. (Inherited from Object.)|
|MemberwiseClone(Boolean)||Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)|
|ToString||Returns a string representation of this column header. (Overrides Component.ToString().)|
A column header is an item in a ListView control that contains heading text. objects can be added to a ListView using the Add method of the ListView.ColumnHeaderCollection class. To add a group of columns to a ListView, you can use the AddRange method of the ListView.ColumnHeaderCollection class. You can use the Index property of the class to determine where the is located in the ListView.ColumnHeaderCollection.
provides the Text and TextAlign properties to set the text displayed in the control and the alignment of the text in the column header. To determine whether a is associated with a ListView control, you can reference the ListView property. If you want to copy a for use in another ListView control, you can use the Clone method.
The following code example demonstrates initializing a ListView control. The example creates objects and sets the column header's Text, TextAlign and Width properties. The example also adds items and subitems to the ListView. To run this example paste the following code in a form and call the PopulateListView method from the form's constructor or Load event handler.
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.