Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
5998 lines (5251 sloc) 482 KB
<Type Name="ListView" FullName="System.Windows.Forms.ListView">
<TypeSignature Language="C#" Value="public class ListView : System.Windows.Forms.Control" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ListView extends System.Windows.Forms.Control" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.ListView" />
<TypeSignature Language="VB.NET" Value="Public Class ListView&#xA;Inherits Control" />
<TypeSignature Language="C++ CLI" Value="public ref class ListView : System::Windows::Forms::Control" />
<TypeSignature Language="F#" Value="type ListView = class&#xA; inherit Control" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.Control</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("SelectedIndexChanged")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("Items")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.ListViewDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a Windows list view control, which displays a collection of items that can be displayed using one of four different views.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A <xref:System.Windows.Forms.ListView> control allows you to display a list of items with item text and, optionally, an icon to identify the type of item. For example, the Windows Explorer list of files is similar in appearance to a <xref:System.Windows.Forms.ListView> control. It displays a list of the files and folders currently selected in the tree. Each file and folder displays an icon associated with it to help identify the type of file or folder. The <xref:System.Windows.Forms.ListViewItem> class represents an item within a <xref:System.Windows.Forms.ListView> control. The items that are displayed in the list can be shown in one of five different views. Items can be displayed as large icons, as small icons, or as small icons in a vertical list. Items can also have subitems which contain information that is related to the parent item. The details view allows you to display the item and its subitems in a grid with column headers that identify the information being displayed in a subitem. The tile view, which has limited availability as described below, allows you to display the item and its subitems as a tile that contains a large icon next to the textual information. <xref:System.Windows.Forms.ListView> supports single or multiple selection. The multiple selection feature lets the user select from a list of items in a way similar to a <xref:System.Windows.Forms.ListBox> control. Additionally, the user can activate selected items to perform a task. For example, you could use a <xref:System.Windows.Forms.ListView> control to display a list of files that the application can then open and utilize. The user can select the files to open and then double-click them to activate the items and open the files in the application. The <xref:System.Windows.Forms.ListView> can also display check boxes, using the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property, to allow the user to check the items that they want to perform an action on. You can use the <xref:System.Windows.Forms.ListView> control in a variety of ways. The control can be used to display information from an application, a database, or a text file. The <xref:System.Windows.Forms.ListView> can also be used to obtain information from the user, such as selecting a set of files to process.
<xref:System.Windows.Forms.ListView> provides a large number of properties that provide flexibility in appearance and behavior. The <xref:System.Windows.Forms.ListView.View%2A> property allows you to change the way in which items are displayed. The <xref:System.Windows.Forms.ListView.LargeImageList%2A>, <xref:System.Windows.Forms.ListView.SmallImageList%2A>, and <xref:System.Windows.Forms.ListView.StateImageList%2A> properties allow you to specify the <xref:System.Windows.Forms.ImageList> objects that contain the images displayed for items and, in the case of the <xref:System.Windows.Forms.ListView.StateImageList%2A>, the check boxes that are displayed when the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property is set to `true`. To determine which items are checked, you can use the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property to access the <xref:System.Windows.Forms.ListView.CheckedListViewItemCollection> collection. The <xref:System.Windows.Forms.ListView.Columns%2A> property allows access to the <xref:System.Windows.Forms.ListView.ColumnHeaderCollection>, which stores the column headers that are displayed when the <xref:System.Windows.Forms.ListView.View%2A> property of the control is set to <xref:System.Windows.Forms.View.Details>. Items are added and removed from the <xref:System.Windows.Forms.ListView> through the <xref:System.Windows.Forms.ListView.Items%2A> property. The <xref:System.Windows.Forms.ListView.Items%2A> property allows you to access the <xref:System.Windows.Forms.ListView.ListViewItemCollection> of the control, which provides methods for manipulating the items in the control. If you want to allow the user to edit the text of an item, you can use the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property. When your control contains a large number of items, it is often easier for the user to see them in a sorted list. You can use the <xref:System.Windows.Forms.ListView.Sorting%2A> property to sort the items alphabetically. You can also completely customize the appearance of a <xref:System.Windows.Forms.ListView> control. To do this, set the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property to `true` and handle one or more of the following events: <xref:System.Windows.Forms.ListView.DrawItem>, <xref:System.Windows.Forms.ListView.DrawSubItem>, <xref:System.Windows.Forms.ListView.DrawColumnHeader>.
Many of the properties of the <xref:System.Windows.Forms.ListView> control are used when the <xref:System.Windows.Forms.ListView.View%2A> property of the control is set to <xref:System.Windows.Forms.View.Details>. The <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> property allows the user of your <xref:System.Windows.Forms.ListView> control to reconfigure the order of columns at run time. The <xref:System.Windows.Forms.ListView.FullRowSelect%2A> property allows an item and its subitems to be selected instead of just the item. To display gridlines in the details view to identify the boundaries of items and subitems in the <xref:System.Windows.Forms.ListView>, you can use the <xref:System.Windows.Forms.ListView.GridLines%2A> property. The <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property allows you to specify the type of column headers to display.
A <xref:System.Windows.Forms.ListView> control can operate in virtual mode, where <xref:System.Windows.Forms.ListViewItem> objects are generated dynamically instead of being stored in the <xref:System.Windows.Forms.ListView.Items%2A> collection. This can be useful for dealing with very large lists or lists whose contents frequently change. To enable Virtual mode, set the <xref:System.Windows.Forms.ListView.VirtualMode%2A> property to `true` and handle the <xref:System.Windows.Forms.ListView.RetrieveVirtualItem>, <xref:System.Windows.Forms.ListView.CacheVirtualItems>, and <xref:System.Windows.Forms.ListView.SearchForVirtualItem> events.
In addition to the many properties that are available for a <xref:System.Windows.Forms.ListView> control, there are methods and events that your application can use to provide additional capabilities to the <xref:System.Windows.Forms.ListView>. The <xref:System.Windows.Forms.ListView.BeginUpdate%2A> and <xref:System.Windows.Forms.ListView.EndUpdate%2A> methods allow you to improve performance when you add many items to a <xref:System.Windows.Forms.ListView> by preventing the control from repainting every time that an item is added. If your <xref:System.Windows.Forms.ListView> control is displaying items and subitems, you may want to provide functionality when the user right-clicks a subitem. To determine the item whose subitem is being clicked, you can use the <xref:System.Windows.Forms.ListView.GetItemAt%2A> method. When performing validation of the items after the user has edited them, you may want to display a specific item to the user to change. The <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method can be called to ensure that the specific item is in the visible area of the control.
If the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property set to `true`, you can perform tasks such as validating the text being edited before and after the text changed by creating an event handler for the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> and <xref:System.Windows.Forms.ListView.AfterLabelEdit> events. To perform tasks such as opening a file or displaying a dialog box to edit an item displayed in a <xref:System.Windows.Forms.ListView>, you can create an event handler for the <xref:System.Windows.Forms.ListView.ItemActivate> event. If you allow the user to sort the items in a <xref:System.Windows.Forms.ListView> when they click a column header, you can create an event handler for the <xref:System.Windows.Forms.ListView.ColumnClick> event to perform the sorting. When the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property is set to `true`, you can determine when a change in an item's check state has occurred by handling the <xref:System.Windows.Forms.ListView.ItemCheck> event.
You can also set a background image for the <xref:System.Windows.Forms.ListView> with the <xref:System.Windows.Forms.Control.BackgroundImage%2A> property. Your application must have the <xref:System.STAThreadAttribute> on its `Main` method to correctly display the background image for the <xref:System.Windows.Forms.ListView> control. In addition, if a <xref:System.Windows.Forms.ListView> control with a background image is hosted in Internet Explorer, specify comctl32.dll version 6.0 as a dependent assembly in the application manifest file to ensure the background image is property displayed.
> [!NOTE]
> Setting the <xref:System.Windows.Forms.Control.Cursor%2A> property for a <xref:System.Windows.Forms.ListView> control has no affect on the appearance of the cursor in [!INCLUDE[dnprdnshort](~/includes/dnprdnshort-md.md)] versions 1.1 and earlier.
Windows XP and Windows Server 2003 provide three features that enhance the <xref:System.Windows.Forms.ListView> control when your application calls the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method: tile view, grouping, and the insertion mark.
The tile view lets you balance graphical and textual information by displaying item and subitem text next to large icons. Set the <xref:System.Windows.Forms.ListView.View%2A> property to <xref:System.Windows.Forms.View.Tile?displayProperty=nameWithType> to enable this behavior.
The grouping feature lets you visually group items into related categories. Use the <xref:System.Windows.Forms.ListView.Groups%2A> property to add <xref:System.Windows.Forms.ListViewGroup> objects to the <xref:System.Windows.Forms.ListView> control when you want to enable this feature. To temporarily disable the feature, set the <xref:System.Windows.Forms.ListView.ShowGroups%2A> property to `false`.
The insertion mark feature lets you provide drag-and-drop item repositioning with visual feedback to indicate drop locations. Use the <xref:System.Windows.Forms.ListViewInsertionMark> object retrieved through the <xref:System.Windows.Forms.ListView.InsertionMark%2A> property to display the insertion mark.
These features are available only under Windows XP and Windows Server 2003. On earlier operating systems, the code that relate to these features has no effect, the tile view appears as the large icon view, and the insertion mark and groups do not display. In some cases, you might want to include code that determines whether these features are available, and provide alternate functionality when they are unavailable. These features are provided by the same library that provides the operating system themes feature. To check for the availability of this library, call the <xref:System.Windows.Forms.FeatureSupport.IsPresent%28System.Object%29?displayProperty=nameWithType> method overload and pass in the <xref:System.Windows.Forms.OSFeature.Themes?displayProperty=nameWithType> value.
The following table shows some of the <xref:System.Windows.Forms.ListView> members and the views they are valid in.
|ListView member|View|
|---------------------|----------|
|<xref:System.Windows.Forms.ListView.Alignment%2A> property|<xref:System.Windows.Forms.View.SmallIcon> or <xref:System.Windows.Forms.View.LargeIcon>|
|<xref:System.Windows.Forms.ListView.AutoArrange%2A> property|<xref:System.Windows.Forms.View.SmallIcon> or <xref:System.Windows.Forms.View.LargeIcon>|
|<xref:System.Windows.Forms.ListView.AutoResizeColumn%2A> method|<xref:System.Windows.Forms.View.Details>|
|<xref:System.Windows.Forms.ListView.Columns%2A> property|<xref:System.Windows.Forms.View.Details> or <xref:System.Windows.Forms.View.Tile>|
|<xref:System.Windows.Forms.ListView.DrawSubItem> event|<xref:System.Windows.Forms.View.Details>|
|<xref:System.Windows.Forms.ListView.FindItemWithText%2A> method|<xref:System.Windows.Forms.View.Details>, <xref:System.Windows.Forms.View.List>, or <xref:System.Windows.Forms.View.Tile>|
|<xref:System.Windows.Forms.ListView.FindNearestItem%2A> method|<xref:System.Windows.Forms.View.SmallIcon> or <xref:System.Windows.Forms.View.LargeIcon>|
|<xref:System.Windows.Forms.ListView.GetItemAt%2A> method|<xref:System.Windows.Forms.View.Details> or <xref:System.Windows.Forms.View.Tile>|
|<xref:System.Windows.Forms.ListView.Groups%2A> property|All views except <xref:System.Windows.Forms.View.List>|
|<xref:System.Windows.Forms.ListView.HeaderStyle%2A> property|<xref:System.Windows.Forms.View.Details>|
|<xref:System.Windows.Forms.ListView.InsertionMark%2A> property|<xref:System.Windows.Forms.View.LargeIcon>, <xref:System.Windows.Forms.View.SmallIcon>, or <xref:System.Windows.Forms.View.Tile>|
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control:
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListViewItem" />
<altmember cref="T:System.Windows.Forms.ImageList" />
<altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ListView ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ListView();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.ListView" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control:
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Activation">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ItemActivation Activation { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ItemActivation Activation" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.Activation" />
<MemberSignature Language="VB.NET" Value="Public Property Activation As ItemActivation" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ItemActivation Activation { System::Windows::Forms::ItemActivation get(); void set(System::Windows::Forms::ItemActivation value); };" />
<MemberSignature Language="F#" Value="member this.Activation : System.Windows.Forms.ItemActivation with get, set" Usage="System.Windows.Forms.ListView.Activation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ItemActivation</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the type of action the user must take to activate an item.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ItemActivation" /> values. The default is <see cref="F:System.Windows.Forms.ItemActivation.Standard" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.Activation%2A> property allows you to specify how the user will activate an item in the <xref:System.Windows.Forms.ListView> control. Activating an item in a <xref:System.Windows.Forms.ListView> differs from just selecting an item. When an item is activated, an action is typically performed in an event handler for the <xref:System.Windows.Forms.ListView.ItemActivate> event. For example, when an item is activated you might open a file or display a dialog box that allows the item to be edited. Typically, an item is double-clicked by the user to activate it. If the <xref:System.Windows.Forms.ListView.Activation%2A> property is set to <xref:System.Windows.Forms.ItemActivation.OneClick>, clicking the item one time activates it. Setting the <xref:System.Windows.Forms.ListView.Activation%2A> property to <xref:System.Windows.Forms.ItemActivation.TwoClick> differs from the standard double-click because the two clicks can have any duration between them.
> [!NOTE]
> If the <xref:System.Windows.Forms.ListView.Activation%2A> property is set to <xref:System.Windows.Forms.ItemActivation.OneClick> or <xref:System.Windows.Forms.ItemActivation.TwoClick>, label editing will not be allowed regardless of the value of the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ItemActivation" /> members.</exception>
<altmember cref="T:System.Windows.Forms.ItemActivation" />
<altmember cref="E:System.Windows.Forms.ListView.ItemActivate" />
</Docs>
</Member>
<Member MemberName="AfterLabelEdit">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.LabelEditEventHandler AfterLabelEdit;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.LabelEditEventHandler AfterLabelEdit" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.AfterLabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Custom Event AfterLabelEdit As LabelEditEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::LabelEditEventHandler ^ AfterLabelEdit;" />
<MemberSignature Language="F#" Value="member this.AfterLabelEdit : System.Windows.Forms.LabelEditEventHandler " Usage="member this.AfterLabelEdit : System.Windows.Forms.LabelEditEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.LabelEditEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the label for an item is edited by the user.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.AfterLabelEdit> event occurs when the user finishes modifying the text for an item. The new string that the user types for the item is passed to the event, and the event handler can reject the change. If the event handler rejects the change, the text reverts to the text as it was before the user began editing the item.
> [!NOTE]
> Because the <xref:System.Windows.Forms.ListView.AfterLabelEdit?displayProperty=nameWithType> event takes place before the label edit is committed, calling the <xref:System.Windows.Forms.ListView.Sort%2A?displayProperty=nameWithType> method in a handler for this event will sort the item using the original value.
In order for the <xref:System.Windows.Forms.ListView.AfterLabelEdit> event to be raised, the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control must be set to `true`.
You can create an event handler for the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event to perform tasks before the user edits the text of an item.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView.AfterLabelEdit> event to restrict a newly edited label to characters in the alphabet. The example uses the <xref:System.Text.ASCIIEncoding> class to obtain the ASCII character code of each character of the new label. If the character falls between the ASCII codes that represent numbers, the new label cannot be applied to the item. This example requires that you have created a <xref:System.Windows.Forms.ListView> control on a form and added items to it. The example also requires that you have connected the <xref:System.Windows.Forms.ListView.AfterLabelEdit> event to the event handler defined in the example code. In order to use the <xref:System.Text.ASCIIEncoding> class, your file must include the <xref:System.Text> namespace.
[!code-cpp[ListView.AfterLabelEdit#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListView.AfterLabelEdit/CPP/form1.cpp#1)]
[!code-csharp[ListView.AfterLabelEdit#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListView.AfterLabelEdit/CS/form1.cs#1)]
[!code-vb[ListView.AfterLabelEdit#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListView.AfterLabelEdit/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.OnAfterLabelEdit(System.Windows.Forms.LabelEditEventArgs)" />
<altmember cref="E:System.Windows.Forms.ListView.BeforeLabelEdit" />
<altmember cref="T:System.Windows.Forms.LabelEditEventHandler" />
<altmember cref="P:System.Windows.Forms.ListView.LabelEdit" />
</Docs>
</Member>
<Member MemberName="Alignment">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewAlignment Alignment { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ListViewAlignment Alignment" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.Alignment" />
<MemberSignature Language="VB.NET" Value="Public Property Alignment As ListViewAlignment" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ListViewAlignment Alignment { System::Windows::Forms::ListViewAlignment get(); void set(System::Windows::Forms::ListViewAlignment value); };" />
<MemberSignature Language="F#" Value="member this.Alignment : System.Windows.Forms.ListViewAlignment with get, set" Usage="System.Windows.Forms.ListView.Alignment" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewAlignment</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the alignment of items in the control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> values. The default is <see cref="F:System.Windows.Forms.ListViewAlignment.Top" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.Alignment%2A> property only affects alignment when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>.
> [!NOTE]
> This property has no effect with the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.List>.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> values.</exception>
<altmember cref="T:System.Windows.Forms.ListViewAlignment" />
</Docs>
</Member>
<Member MemberName="AllowColumnReorder">
<MemberSignature Language="C#" Value="public bool AllowColumnReorder { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowColumnReorder" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.AllowColumnReorder" />
<MemberSignature Language="VB.NET" Value="Public Property AllowColumnReorder As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AllowColumnReorder { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowColumnReorder : bool with get, set" Usage="System.Windows.Forms.ListView.AllowColumnReorder" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the user can drag column headers to reorder columns in the control.</summary>
<value>
<see langword="true" /> if drag-and-drop column reordering is allowed; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting the value of the <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> property has no effect unless the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details>. You can use this property to allow users to reposition columns in the control at run time. When the <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A> property is set to `true`, users can position the columns in the control to display the item and its subitems in a way that meets their needs within your application.
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control:
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="T:System.Windows.Forms.View" />
</Docs>
</Member>
<MemberGroup MemberName="ArrangeIcons">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Arranges items in the control when they are displayed as icons.</summary>
</Docs>
</MemberGroup>
<Member MemberName="ArrangeIcons">
<MemberSignature Language="C#" Value="public void ArrangeIcons ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ArrangeIcons() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.ArrangeIcons" />
<MemberSignature Language="VB.NET" Value="Public Sub ArrangeIcons ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ArrangeIcons();" />
<MemberSignature Language="F#" Value="member this.ArrangeIcons : unit -&gt; unit" Usage="listView.ArrangeIcons " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Arranges items in the control when they are displayed as icons based on the value of the <see cref="P:System.Windows.Forms.ListView.Alignment" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method is only useful when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>. Calling this version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method arranges the items based on the value of the <xref:System.Windows.Forms.ListView.Alignment%2A> property. To cause the items to be aligned based on a value that differs from that of the <xref:System.Windows.Forms.ListView.Alignment%2A> property, use the other version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.Alignment" />
</Docs>
</Member>
<Member MemberName="ArrangeIcons">
<MemberSignature Language="C#" Value="public void ArrangeIcons (System.Windows.Forms.ListViewAlignment value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ArrangeIcons(valuetype System.Windows.Forms.ListViewAlignment value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.ArrangeIcons(System.Windows.Forms.ListViewAlignment)" />
<MemberSignature Language="VB.NET" Value="Public Sub ArrangeIcons (value As ListViewAlignment)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ArrangeIcons(System::Windows::Forms::ListViewAlignment value);" />
<MemberSignature Language="F#" Value="member this.ArrangeIcons : System.Windows.Forms.ListViewAlignment -&gt; unit" Usage="listView.ArrangeIcons value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Windows.Forms.ListViewAlignment" />
</Parameters>
<Docs>
<param name="value">One of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> values.</param>
<summary>Arranges items in the control when they are displayed as icons with a specified alignment setting.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method is only useful when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>. This version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method arranges the icons in the <xref:System.Windows.Forms.ListView> based on the <xref:System.Windows.Forms.ListViewAlignment> value specified in the `value` parameter. Calling this method does not change the value of the <xref:System.Windows.Forms.ListView.Alignment%2A> property of the control. This method is used to arrange icons on the control using a different value than that of the <xref:System.Windows.Forms.ListView.Alignment%2A> property. To cause the items to be aligned based on the value of the <xref:System.Windows.Forms.ListView.Alignment%2A> property, use the other version of the <xref:System.Windows.Forms.ListView.ArrangeIcons%2A> method.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The value specified in the <paramref name="value" /> parameter is not a member of the <see cref="T:System.Windows.Forms.ListViewAlignment" /> enumeration.</exception>
<altmember cref="T:System.Windows.Forms.ListViewAlignment" />
<altmember cref="P:System.Windows.Forms.ListView.Alignment" />
</Docs>
</Member>
<Member MemberName="AutoArrange">
<MemberSignature Language="C#" Value="public bool AutoArrange { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoArrange" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.AutoArrange" />
<MemberSignature Language="VB.NET" Value="Public Property AutoArrange As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AutoArrange { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoArrange : bool with get, set" Usage="System.Windows.Forms.ListView.AutoArrange" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets whether icons are automatically kept arranged.</summary>
<value>
<see langword="true" /> if icons are automatically kept arranged and snapped to the grid; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.AutoArrange%2A> property only arranges items in the <xref:System.Windows.Forms.ListView> control when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.LargeIcon> or <xref:System.Windows.Forms.View.SmallIcon>. To change the alignment of items in the <xref:System.Windows.Forms.ListView> control, use the <xref:System.Windows.Forms.ListView.Alignment%2A> property. You can use <xref:System.Windows.Forms.ListView.AutoArrange%2A> to ensure that all items in your <xref:System.Windows.Forms.ListView> control are automatically arranged to avoid overlapping at run time.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.Alignment" />
</Docs>
</Member>
<Member MemberName="AutoResizeColumn">
<MemberSignature Language="C#" Value="public void AutoResizeColumn (int columnIndex, System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AutoResizeColumn(int32 columnIndex, valuetype System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.AutoResizeColumn(System.Int32,System.Windows.Forms.ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="VB.NET" Value="Public Sub AutoResizeColumn (columnIndex As Integer, headerAutoResize As ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AutoResizeColumn(int columnIndex, System::Windows::Forms::ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberSignature Language="F#" Value="member this.AutoResizeColumn : int * System.Windows.Forms.ColumnHeaderAutoResizeStyle -&gt; unit" Usage="listView.AutoResizeColumn (columnIndex, headerAutoResize)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="columnIndex" Type="System.Int32" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="headerAutoResize" Type="System.Windows.Forms.ColumnHeaderAutoResizeStyle" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="columnIndex">The zero-based index of the column to resize.</param>
<param name="headerAutoResize">One of the <see cref="T:System.Windows.Forms.ColumnHeaderAutoResizeStyle" /> values.</param>
<summary>Resizes the width of the given column as indicated by the resize style.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method is only effective once the <xref:System.Windows.Forms.ListView> and containing <xref:System.Windows.Forms.Form> have been constructed, and the <xref:System.Windows.Forms.ListView> column headers and columns are populated with items. If new items are added to the <xref:System.Windows.Forms.ListView>, the columns will not resize unless <xref:System.Windows.Forms.ListView.AutoResizeColumn%2A> is called again.
## Examples
The following example initializes a <xref:System.Windows.Forms.ListView> in detail view and automatically resizes the columns using the <xref:System.Windows.Forms.ListView.AutoResizeColumn%2A> method. To run this example, paste this code into a Windows Form and call the `InitializeResizingListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-csharp[System.Windows.Forms.ListViewWhidbeyProperties#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListViewWhidbeyProperties#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="columnIndex" /> is greater than 0 when <see cref="P:System.Windows.Forms.ListView.Columns" /> is <see langword="null" />
-or-
<paramref name="columnIndex" /> is less than 0 or greater than the number of columns set.</exception>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">
<paramref name="headerAutoResize" /> is not a member of the <see cref="T:System.Windows.Forms.ColumnHeaderAutoResizeStyle" /> enumeration.</exception>
</Docs>
</Member>
<Member MemberName="AutoResizeColumns">
<MemberSignature Language="C#" Value="public void AutoResizeColumns (System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AutoResizeColumns(valuetype System.Windows.Forms.ColumnHeaderAutoResizeStyle headerAutoResize) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.AutoResizeColumns(System.Windows.Forms.ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="VB.NET" Value="Public Sub AutoResizeColumns (headerAutoResize As ColumnHeaderAutoResizeStyle)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AutoResizeColumns(System::Windows::Forms::ColumnHeaderAutoResizeStyle headerAutoResize);" />
<MemberSignature Language="F#" Value="member this.AutoResizeColumns : System.Windows.Forms.ColumnHeaderAutoResizeStyle -&gt; unit" Usage="listView.AutoResizeColumns headerAutoResize" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="headerAutoResize" Type="System.Windows.Forms.ColumnHeaderAutoResizeStyle" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="headerAutoResize">One of the <see cref="T:System.Windows.Forms.ColumnHeaderAutoResizeStyle" /> values.</param>
<summary>Resizes the width of the columns as indicated by the resize style.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method is only effective once the <xref:System.Windows.Forms.ListView> and containing <xref:System.Windows.Forms.Form> have been constructed, and the <xref:System.Windows.Forms.ListView> column headers and columns are populated with items. If new items are added to the <xref:System.Windows.Forms.ListView>, the columns will not resize unless <xref:System.Windows.Forms.ListView.AutoResizeColumns%2A> is called again.
## Examples
The following code example demonstrates initializing a <xref:System.Windows.Forms.ListView> in detail view and automatically resizing the columns using the <xref:System.Windows.Forms.ListView.AutoResizeColumns%2A> method. To run this example, paste this code into a Windows Form and call the `InitializeResizingListView2` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-csharp[System.Windows.Forms.ListViewWhidbeyProperties#9](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/CS/form1.cs#9)]
[!code-vb[System.Windows.Forms.ListViewWhidbeyProperties#9](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb#9)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.Windows.Forms.ListView.AutoResizeColumn(System.Int32,System.Windows.Forms.ColumnHeaderAutoResizeStyle)" /> is called with a value other than <see cref="F:System.Windows.Forms.ColumnHeaderAutoResizeStyle.None" /> when <see cref="P:System.Windows.Forms.ListView.View" /> is not set to <see cref="F:System.Windows.Forms.View.Details" />.</exception>
</Docs>
</Member>
<Member MemberName="BackColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color BackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BackColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.BackColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.ListView.BackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background color.</summary>
<value>The <see cref="T:System.Drawing.Color" /> of the background.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImage">
<MemberSignature Language="C#" Value="public override System.Drawing.Image BackgroundImage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Image BackgroundImage" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackgroundImage" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImage As Image" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Image ^ BackgroundImage { System::Drawing::Image ^ get(); void set(System::Drawing::Image ^ value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImage : System.Drawing.Image with get, set" Usage="System.Windows.Forms.ListView.BackgroundImage" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Image</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the background image displayed in this <see cref="T:System.Windows.Forms.ListView" /> control.</summary>
<value>The image to display in the background of the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.BackgroundImageChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageChanged : EventHandler " Usage="member this.BackgroundImageChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the value of the <see cref="P:System.Windows.Forms.ListView.BackgroundImage" /> property changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayout">
<MemberSignature Language="C#" Value="public override System.Windows.Forms.ImageLayout BackgroundImageLayout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ImageLayout BackgroundImageLayout" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackgroundImageLayout" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackgroundImageLayout As ImageLayout" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Windows::Forms::ImageLayout BackgroundImageLayout { System::Windows::Forms::ImageLayout get(); void set(System::Windows::Forms::ImageLayout value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayout : System.Windows.Forms.ImageLayout with get, set" Usage="System.Windows.Forms.ListView.BackgroundImageLayout" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ImageLayout</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an <see cref="T:System.Windows.Forms.ImageLayout" /> value.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ImageLayout" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property has no effect on the layout of the background image of the <xref:System.Windows.Forms.ListView> control, therefore it is not shown in the designer or by IntelliSense.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ImageLayout" /> values.</exception>
</Docs>
</Member>
<Member MemberName="BackgroundImageLayoutChanged">
<MemberSignature Language="C#" Value="public event EventHandler BackgroundImageLayoutChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler BackgroundImageLayoutChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.BackgroundImageLayoutChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BackgroundImageLayoutChanged As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ BackgroundImageLayoutChanged;" />
<MemberSignature Language="F#" Value="member this.BackgroundImageLayoutChanged : EventHandler " Usage="member this.BackgroundImageLayoutChanged : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.ListView.BackgroundImageLayout" /> property changes.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="BackgroundImageTiled">
<MemberSignature Language="C#" Value="public bool BackgroundImageTiled { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool BackgroundImageTiled" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BackgroundImageTiled" />
<MemberSignature Language="VB.NET" Value="Public Property BackgroundImageTiled As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool BackgroundImageTiled { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.BackgroundImageTiled : bool with get, set" Usage="System.Windows.Forms.ListView.BackgroundImageTiled" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the background image of the <see cref="T:System.Windows.Forms.ListView" /> should be tiled.</summary>
<value>
<see langword="true" /> if the background image of the <see cref="T:System.Windows.Forms.ListView" /> should be tiled; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.BackgroundImageTiled%2A> property returns `false` if an image is not set.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BeforeLabelEdit">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.LabelEditEventHandler BeforeLabelEdit;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.LabelEditEventHandler BeforeLabelEdit" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.BeforeLabelEdit" />
<MemberSignature Language="VB.NET" Value="Public Custom Event BeforeLabelEdit As LabelEditEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::LabelEditEventHandler ^ BeforeLabelEdit;" />
<MemberSignature Language="F#" Value="member this.BeforeLabelEdit : System.Windows.Forms.LabelEditEventHandler " Usage="member this.BeforeLabelEdit : System.Windows.Forms.LabelEditEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.LabelEditEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user starts editing the label of an item.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event occurs when the user starts modifying the text for an item. If the event handler cancels this event, the user cannot edit the text. You can use this event to prevent the user from editing specific items in the <xref:System.Windows.Forms.ListView> control. If the <xref:System.Windows.Forms.ListView.LabelEdit%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `false`, the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event is not raised; all user attempts to edit item labels are automatically rejected.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates handling the <xref:System.Windows.Forms.ListView.BeforeLabelEdit> event and using the <xref:System.Windows.Forms.LabelEditEventArgs.Item%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.LabelEditEventArgs.CancelEdit%2A?displayProperty=nameWithType> properties. To run the example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> control named `ListView1` and populated with at least three items. Ensure the event handler in the example is associated with its event.
[!code-cpp[System.Windows.Forms.ListView3#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView3/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView3#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView3/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView3#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView3/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.OnBeforeLabelEdit(System.Windows.Forms.LabelEditEventArgs)" />
<altmember cref="E:System.Windows.Forms.ListView.AfterLabelEdit" />
<altmember cref="T:System.Windows.Forms.LabelEditEventHandler" />
<altmember cref="P:System.Windows.Forms.ListView.LabelEdit" />
</Docs>
</Member>
<Member MemberName="BeginUpdate">
<MemberSignature Language="C#" Value="public void BeginUpdate ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void BeginUpdate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.BeginUpdate" />
<MemberSignature Language="VB.NET" Value="Public Sub BeginUpdate ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void BeginUpdate();" />
<MemberSignature Language="F#" Value="member this.BeginUpdate : unit -&gt; unit" Usage="listView.BeginUpdate " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Prevents the control from drawing until the <see cref="M:System.Windows.Forms.ListView.EndUpdate" /> method is called.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The preferred way to add multiple items to a <xref:System.Windows.Forms.ListView> is to use the <xref:System.Windows.Forms.ListView.ListViewItemCollection.AddRange%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> (accessed through the <xref:System.Windows.Forms.ListView.Items%2A> property of the <xref:System.Windows.Forms.ListView>). This enables you to add an array of items to the list in a single operation. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ListView.ListViewItemCollection.Add%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> class, you can use the <xref:System.Windows.Forms.ListView.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ListView> every time that an item is added. When you have completed the task of adding items to the control, call the <xref:System.Windows.Forms.ListView.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ListView> to repaint. This way of adding items can prevent flickered drawing of the <xref:System.Windows.Forms.ListView> when lots of items are being added to the control.
If <xref:System.Windows.Forms.ListView.BeginUpdate%2A> is called more than once, <xref:System.Windows.Forms.ListView.EndUpdate%2A> must be called an equivalent number of times. Until the last call to <xref:System.Windows.Forms.ListView.EndUpdate%2A> the <xref:System.Windows.Forms.ListView> will not repaint. Other than this, multiple calls to <xref:System.Windows.Forms.ListView.BeginUpdate%2A> have no effect.
## Examples
The following code example demonstrates initializing a <xref:System.Windows.Forms.ListView> control to contain check boxes. It also demonstrates how to use the <xref:System.Windows.Forms.ListView.BeginUpdate%2A> and <xref:System.Windows.Forms.ListView.EndUpdate%2A> methods. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> named `ListView1`. Call the `InitializeListView` method from the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.ListView2#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView2#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView2#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView2/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.EndUpdate" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.AddRange(System.Windows.Forms.ListViewItem[])" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.Add(System.String)" />
</Docs>
</Member>
<Member MemberName="BorderStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.BorderStyle BorderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.BorderStyle BorderStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.BorderStyle" />
<MemberSignature Language="VB.NET" Value="Public Property BorderStyle As BorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };" />
<MemberSignature Language="F#" Value="member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set" Usage="System.Windows.Forms.ListView.BorderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(-504)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.BorderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the border style of the control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.BorderStyle" /> values. The default is <see cref="F:System.Windows.Forms.BorderStyle.Fixed3D" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.Windows.Forms.ListView.BorderStyle%2A> property to change the border style of the <xref:System.Windows.Forms.ListView> control to match the border style settings of other controls on the form. For example, if none of the other controls on your form displays a border, you can set the <xref:System.Windows.Forms.ListView.BorderStyle%2A> property of the <xref:System.Windows.Forms.ListView> control to <xref:System.Windows.Forms.BorderStyle.None> to match the other controls.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.BorderStyle" /> values.</exception>
<altmember cref="T:System.Windows.Forms.BorderStyle" />
</Docs>
</Member>
<Member MemberName="CacheVirtualItems">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.CacheVirtualItemsEventHandler CacheVirtualItems;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.CacheVirtualItemsEventHandler CacheVirtualItems" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.CacheVirtualItems" />
<MemberSignature Language="VB.NET" Value="Public Custom Event CacheVirtualItems As CacheVirtualItemsEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::CacheVirtualItemsEventHandler ^ CacheVirtualItems;" />
<MemberSignature Language="F#" Value="member this.CacheVirtualItems : System.Windows.Forms.CacheVirtualItemsEventHandler " Usage="member this.CacheVirtualItems : System.Windows.Forms.CacheVirtualItemsEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.CacheVirtualItemsEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the contents of the display area for a <see cref="T:System.Windows.Forms.ListView" /> in virtual mode has changed, and the <see cref="T:System.Windows.Forms.ListView" /> determines that a new range of items is needed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event only occurs when <xref:System.Windows.Forms.ListView.VirtualMode%2A> is `true`. Handling this event allows the <xref:System.Windows.Forms.ListView> to update the item information held in the cache so that it is readily available. This can improve performance on large lists, or lists whose items are expensive to calculate.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, the event handler checks to make sure a cache refresh is really necessary, and then rebuilds the cache. This code example is part of a larger example provided for the <xref:System.Windows.Forms.ListView.VirtualMode%2A> property.
[!code-csharp[System.Windows.Forms.ListView.VirtualMode#3](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView.VirtualMode/cs/VirtualMode.cs#3)]
[!code-vb[System.Windows.Forms.ListView.VirtualMode#3](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView.VirtualMode/vb/VirtualMode.vb#3)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CheckBoxes">
<MemberSignature Language="C#" Value="public bool CheckBoxes { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CheckBoxes" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.CheckBoxes" />
<MemberSignature Language="VB.NET" Value="Public Property CheckBoxes As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool CheckBoxes { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.CheckBoxes : bool with get, set" Usage="System.Windows.Forms.ListView.CheckBoxes" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether a check box appears next to each item in the control.</summary>
<value>
<see langword="true" /> if a check box appears next to each item in the <see cref="T:System.Windows.Forms.ListView" /> control; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property allows you to display a check box next to each item in the list. This enables your application to display a list of items (and subitems if the <xref:System.Windows.Forms.ListView.View%2A> property is set to `View.Details`) that the user can select by clicking the check box. The <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property offers a way to select multiple items in the <xref:System.Windows.Forms.ListView> control without using the CTRL key. Depending on your application, using check boxes to select items rather than the standard multiple selection method may be easier for the user. Even if the <xref:System.Windows.Forms.ListView.MultiSelect%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `false`, you can still display checkboxes and provide multiple selection capabilities to the user. This feature can be useful if you do not want multiple items to be selected yet still want to allow the user to choose multiple items from the list to perform an operation within your application.
To determine when an item has been checked, create an event handler for the <xref:System.Windows.Forms.ListView.ItemCheck> event. To get all the items that are checked in the <xref:System.Windows.Forms.ListView>, use the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property to access the <xref:System.Windows.Forms.ListView.CheckedIndexCollection> for the control. To get the indexes of all items that are checked in the <xref:System.Windows.Forms.ListView>, use the <xref:System.Windows.Forms.ListView.CheckedIndices%2A> property.
If an <xref:System.Windows.Forms.ImageList> is specified in the <xref:System.Windows.Forms.ListView.StateImageList%2A> property, the images at index positions 0 and 1 in the <xref:System.Windows.Forms.ImageList> are displayed instead of the check box. The image at index position 0 is displayed instead of the unchecked check box, and the image at index position 1 is displayed instead of the checked check box.
> [!NOTE]
> When you set this property to `true`, the <xref:System.Windows.Forms.ListView.ItemCheck> event occurs.
>
> Check boxes are not displayed when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Tile>.
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control.
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.StateImageList" />
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="P:System.Windows.Forms.ListView.MultiSelect" />
</Docs>
</Member>
<Member MemberName="CheckedIndices">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListView.CheckedIndexCollection CheckedIndices { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ListView/CheckedIndexCollection CheckedIndices" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.CheckedIndices" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CheckedIndices As ListView.CheckedIndexCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ListView::CheckedIndexCollection ^ CheckedIndices { System::Windows::Forms::ListView::CheckedIndexCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CheckedIndices : System.Windows.Forms.ListView.CheckedIndexCollection" Usage="System.Windows.Forms.ListView.CheckedIndices" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListView+CheckedIndexCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the indexes of the currently checked items in the control.</summary>
<value>A <see cref="T:System.Windows.Forms.ListView.CheckedIndexCollection" /> that contains the indexes of the currently checked items. If no items are currently checked, an empty <see cref="T:System.Windows.Forms.ListView.CheckedIndexCollection" /> is returned.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is only useful when the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `true`. The <xref:System.Windows.Forms.ListView.CheckedIndices%2A> property returns a collection that contains the index positions in the <xref:System.Windows.Forms.ListView.ListViewItemCollection> of all items that are checked in the control. For more information about how to manipulate the items in the collection, see <xref:System.Windows.Forms.ListView.CheckedIndexCollection>.
If you want to obtain a collection of the items that are checked in the <xref:System.Windows.Forms.ListView> control, instead of the index positions of the items that are checked, use the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListView.CheckedIndexCollection" />
<altmember cref="P:System.Windows.Forms.ListView.CheckedItems" />
</Docs>
</Member>
<Member MemberName="CheckedItems">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListView.CheckedListViewItemCollection CheckedItems { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ListView/CheckedListViewItemCollection CheckedItems" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.CheckedItems" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CheckedItems As ListView.CheckedListViewItemCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ListView::CheckedListViewItemCollection ^ CheckedItems { System::Windows::Forms::ListView::CheckedListViewItemCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CheckedItems : System.Windows.Forms.ListView.CheckedListViewItemCollection" Usage="System.Windows.Forms.ListView.CheckedItems" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListView+CheckedListViewItemCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the currently checked items in the control.</summary>
<value>A <see cref="T:System.Windows.Forms.ListView.CheckedListViewItemCollection" /> that contains the currently checked items. If no items are currently checked, an empty <see cref="T:System.Windows.Forms.ListView.CheckedListViewItemCollection" /> is returned.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is only useful when the <xref:System.Windows.Forms.ListView.CheckBoxes%2A> property of the <xref:System.Windows.Forms.ListView> control is set to `true`. The <xref:System.Windows.Forms.ListView.CheckedItems%2A> property returns a collection that contains all items that are checked in the control. For more information about how to manipulate the items in the collection, see <xref:System.Windows.Forms.ListView.CheckedListViewItemCollection>.
If you want to obtain a collection of the index positions within the <xref:System.Windows.Forms.ListView.ListViewItemCollection> of the items that are checked in the <xref:System.Windows.Forms.ListView> control, instead of the items that are checked, use the <xref:System.Windows.Forms.ListView.CheckedIndices%2A> property.
## Examples
The following code example demonstrates a checked <xref:System.Windows.Forms.ListView> that handles the <xref:System.Windows.Forms.ListView.ItemChecked> event. The example uses the <xref:System.Windows.Forms.ListView.CheckedItems%2A> property to tally a new price every time that an item is checked or unchecked. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> named `ListView1` and a <xref:System.Windows.Forms.TextBox> named `Textbox1`. Call the `InitializeListView` method from the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.ListView2#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView2#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView2#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView2/VB/form1.vb#1)]
[!code-cpp[System.Windows.Forms.ListView2#3](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CPP/form1.cpp#3)]
[!code-csharp[System.Windows.Forms.ListView2#3](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CS/form1.cs#3)]
[!code-vb[System.Windows.Forms.ListView2#3](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView2/VB/form1.vb#3)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListView.CheckedListViewItemCollection" />
<altmember cref="P:System.Windows.Forms.ListView.CheckedIndices" />
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="public void Clear ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Clear() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.Clear" />
<MemberSignature Language="VB.NET" Value="Public Sub Clear ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Clear();" />
<MemberSignature Language="F#" Value="member this.Clear : unit -&gt; unit" Usage="listView.Clear " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Removes all items and columns from the control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method to remove all items and columns from the <xref:System.Windows.Forms.ListView> control without having to call the individual `Clear` methods from the <xref:System.Windows.Forms.ListView.ColumnHeaderCollection> and <xref:System.Windows.Forms.ListView.ListViewItemCollection> classes.
> [!NOTE]
> The <xref:System.Windows.Forms.ListView.Clear%2A> method does not clear <xref:System.Windows.Forms.ListView.Groups%2A> specified for the <xref:System.Windows.Forms.ListView> control. To clear <xref:System.Windows.Forms.ListView.Groups%2A> call <xref:System.Windows.Forms.ListViewGroupCollection.Clear%2A?displayProperty=nameWithType>.
## Examples
The following code example demonstrates the use of <xref:System.Windows.Forms.ListView.Clear%2A> and <xref:System.Windows.Forms.ListViewItem.Selected%2A?displayProperty=nameWithType> members. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> named `ListView1` and a button, located toward the bottom of the form, named `Button1`. Call the `InitializeListView` method from the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.ListView4#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView4/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView4#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView4/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView4#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView4/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.ColumnHeaderCollection.Clear" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.Clear" />
</Docs>
</Member>
<Member MemberName="ColumnClick">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.ColumnClickEventHandler ColumnClick;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.ColumnClickEventHandler ColumnClick" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.ColumnClick" />
<MemberSignature Language="VB.NET" Value="Public Custom Event ColumnClick As ColumnClickEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::ColumnClickEventHandler ^ ColumnClick;" />
<MemberSignature Language="F#" Value="member this.ColumnClick : System.Windows.Forms.ColumnClickEventHandler " Usage="member this.ColumnClick : System.Windows.Forms.ColumnClickEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ColumnClickEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user clicks a column header within the list view control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.ColumnClick> event occurs when the user clicks one of the column headers in a details view of the items in a <xref:System.Windows.Forms.ListView> control (when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details>). The <xref:System.Windows.Forms.ListView.ColumnClick> event is typically handled to sort the items in the <xref:System.Windows.Forms.ListView> using the clicked column as the column to sort by.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example creates a form that contains a <xref:System.Windows.Forms.ListView> control that manually sorts items when a column in the <xref:System.Windows.Forms.ListView> control is clicked. The example defines a class called `ListViewItemComparer` that implements the <xref:System.Collections.IComparer?displayProperty=nameWithType> interface that performs the <xref:System.Windows.Forms.ListViewItem> comparison. The example creates an instance of `ListViewItemComparer` and uses it to set the <xref:System.Windows.Forms.ListView.ListViewItemSorter%2A> property of the <xref:System.Windows.Forms.ListView> control. The <xref:System.Windows.Forms.ListView.Sort%2A> method call in the <xref:System.Windows.Forms.ListView.ColumnClick> event handler uses the methods defined in `ListViewItemComparer` to perform the sort of items, based on the column that is clicked.
[!code-cpp[ListView.ColumnClick#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListView.ColumnClick/CPP/listviewsort1.cpp#1)]
[!code-csharp[ListView.ColumnClick#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListView.ColumnClick/CS/listviewsort1.cs#1)]
[!code-vb[ListView.ColumnClick#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListView.ColumnClick/VB/listviewsort1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.OnColumnClick(System.Windows.Forms.ColumnClickEventArgs)" />
</Docs>
</Member>
<Member MemberName="ColumnReordered">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.ColumnReorderedEventHandler ColumnReordered;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.ColumnReorderedEventHandler ColumnReordered" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.ColumnReordered" />
<MemberSignature Language="VB.NET" Value="Public Custom Event ColumnReordered As ColumnReorderedEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::ColumnReorderedEventHandler ^ ColumnReordered;" />
<MemberSignature Language="F#" Value="member this.ColumnReordered : System.Windows.Forms.ColumnReorderedEventHandler " Usage="member this.ColumnReordered : System.Windows.Forms.ColumnReorderedEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ColumnReorderedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the column header order is changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.ColumnReordered> event is a cancelable event and can be canceled by handling the event and setting the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property to `true`. However, if the event is canceled, the <xref:System.Windows.Forms.ColumnReorderedEventArgs.NewDisplayIndex%2A> of the <xref:System.Windows.Forms.ColumnReorderedEventArgs> will not change to the <xref:System.Windows.Forms.ColumnReorderedEventArgs.OldDisplayIndex%2A> value.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ListView.ColumnReordered> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ListView> named `ListView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ListView.ColumnReordered> event.
[!code-csharp[System.Windows.Forms.EventExamples#467](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#467)]
[!code-vb[System.Windows.Forms.EventExamples#467](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#467)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Columns">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListView.ColumnHeaderCollection Columns { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ListView/ColumnHeaderCollection Columns" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.Columns" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Columns As ListView.ColumnHeaderCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ListView::ColumnHeaderCollection ^ Columns { System::Windows::Forms::ListView::ColumnHeaderCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Columns : System.Windows.Forms.ListView.ColumnHeaderCollection" Usage="System.Windows.Forms.ListView.Columns" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ColumnHeaderCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.MergableProperty(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ColumnHeaderCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListView+ColumnHeaderCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the collection of all column headers that appear in the control.</summary>
<value>A <see cref="T:System.Windows.Forms.ListView.ColumnHeaderCollection" /> that represents the column headers that appear when the <see cref="P:System.Windows.Forms.ListView.View" /> property is set to <see cref="F:System.Windows.Forms.View.Details" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.Columns%2A> property returns a collection that contains the <xref:System.Windows.Forms.ColumnHeader> objects that are displayed in the <xref:System.Windows.Forms.ListView> control. <xref:System.Windows.Forms.ColumnHeader> objects define the columns that are displayed in the <xref:System.Windows.Forms.ListView> control when the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details>. Each column is used to display subitem information for each item in the <xref:System.Windows.Forms.ListView>. For more information about how to manipulate the items in the collection, see <xref:System.Windows.Forms.ListView.ColumnHeaderCollection>.
> [!NOTE]
> If your <xref:System.Windows.Forms.ListView> control does not have any column headers specified and you set the <xref:System.Windows.Forms.ListView.View%2A> property to <xref:System.Windows.Forms.View.Details>, the <xref:System.Windows.Forms.ListView> control will not display any items.
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control.
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListView.ColumnHeaderCollection" />
<altmember cref="T:System.Windows.Forms.ColumnHeader" />
</Docs>
</Member>
<Member MemberName="ColumnWidthChanged">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.ColumnWidthChangedEventHandler ColumnWidthChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.ColumnWidthChangedEventHandler ColumnWidthChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.ColumnWidthChanged" />
<MemberSignature Language="VB.NET" Value="Public Custom Event ColumnWidthChanged As ColumnWidthChangedEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::ColumnWidthChangedEventHandler ^ ColumnWidthChanged;" />
<MemberSignature Language="F#" Value="member this.ColumnWidthChanged : System.Windows.Forms.ColumnWidthChangedEventHandler " Usage="member this.ColumnWidthChanged : System.Windows.Forms.ColumnWidthChangedEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ColumnWidthChangedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs after the width of a column is successfully changed.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event will not occur if the column width change is canceled in the <xref:System.Windows.Forms.ListView.ColumnWidthChanging> event
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ListView.ColumnWidthChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.ListView> named `ListView1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.ListView.ColumnWidthChanged> event.
[!code-csharp[System.Windows.Forms.EventExamples#468](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#468)]
[!code-vb[System.Windows.Forms.EventExamples#468](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#468)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ColumnWidthChanging">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.ColumnWidthChangingEventHandler ColumnWidthChanging;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.ColumnWidthChangingEventHandler ColumnWidthChanging" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.ColumnWidthChanging" />
<MemberSignature Language="VB.NET" Value="Public Custom Event ColumnWidthChanging As ColumnWidthChangingEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::ColumnWidthChangingEventHandler ^ ColumnWidthChanging;" />
<MemberSignature Language="F#" Value="member this.ColumnWidthChanging : System.Windows.Forms.ColumnWidthChangingEventHandler " Usage="member this.ColumnWidthChanging : System.Windows.Forms.ColumnWidthChangingEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ColumnWidthChangingEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the width of a column is changing.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event allows you to check the new column width with the <xref:System.Windows.Forms.ColumnWidthChangingEventArgs.NewWidth%2A?displayProperty=nameWithType> property, and cancel the event if you choose by setting the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property to `true`.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates handling the <xref:System.Windows.Forms.ListView.ColumnWidthChanging> event. It also demonstrates the <xref:System.Windows.Forms.ColumnWidthChangingEventArgs.NewWidth%2A?displayProperty=nameWithType> and <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> members. To run this example, paste the code into a Windows Form. Call `InitializeListView1` from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-csharp[System.Windows.Forms.ListViewWhidbeyProperties#6](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/CS/form1.cs#6)]
[!code-vb[System.Windows.Forms.ListViewWhidbeyProperties#6](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb#6)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CreateAccessibilityInstance">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.AccessibleObject CreateAccessibilityInstance ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Windows.Forms.AccessibleObject CreateAccessibilityInstance() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.CreateAccessibilityInstance" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateAccessibilityInstance () As AccessibleObject" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Windows::Forms::AccessibleObject ^ CreateAccessibilityInstance();" />
<MemberSignature Language="F#" Value="override this.CreateAccessibilityInstance : unit -&gt; System.Windows.Forms.AccessibleObject" Usage="listView.CreateAccessibilityInstance " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.AccessibleObject</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a new instance of the accessibility object for the <see cref="T:System.Windows.Forms.ListView" /> control.</summary>
<returns>The <see cref="T:System.Windows.Forms.Control.ControlAccessibleObject" /> for this <see cref="T:System.Windows.Forms.ListView" /> control.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateHandle">
<MemberSignature Language="C#" Value="protected override void CreateHandle ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void CreateHandle() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.CreateHandle" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub CreateHandle ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void CreateHandle();" />
<MemberSignature Language="F#" Value="override this.CreateHandle : unit -&gt; unit" Usage="listView.CreateHandle " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a handle for the control.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateParams">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.CreateParams CreateParams { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.CreateParams CreateParams" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.CreateParams" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property CreateParams As CreateParams" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Windows::Forms::CreateParams ^ CreateParams { System::Windows::Forms::CreateParams ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CreateParams : System.Windows.Forms.CreateParams" Usage="System.Windows.Forms.ListView.CreateParams" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.CreateParams</ReturnType>
</ReturnValue>
<Docs>
<summary>This property is not relevant for this class.</summary>
<value>
<see langword="null" /> in all cases.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is not relevant for this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DefaultSize">
<MemberSignature Language="C#" Value="protected override System.Drawing.Size DefaultSize { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Size DefaultSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.DefaultSize" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultSize As Size" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Drawing::Size DefaultSize { System::Drawing::Size get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultSize : System.Drawing.Size" Usage="System.Windows.Forms.ListView.DefaultSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default size of the control.</summary>
<value>The default <see cref="T:System.Drawing.Size" /> of the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="listView.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.ListView" /> and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call the <xref:System.Windows.Forms.ListView.Dispose%2A> method when the component is no longer needed. This method removes the component from its container (if the component has a site) and triggers the dispose event.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DoubleBuffered">
<MemberSignature Language="C#" Value="protected override bool DoubleBuffered { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool DoubleBuffered" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.DoubleBuffered" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Property DoubleBuffered As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property bool DoubleBuffered { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.DoubleBuffered : bool with get, set" Usage="System.Windows.Forms.ListView.DoubleBuffered" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker.</summary>
<value>
<see langword="true" /> if the surface of the control should be drawn using double buffering; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DrawColumnHeader">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.DrawListViewColumnHeaderEventHandler DrawColumnHeader;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.DrawListViewColumnHeaderEventHandler DrawColumnHeader" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.DrawColumnHeader" />
<MemberSignature Language="VB.NET" Value="Public Custom Event DrawColumnHeader As DrawListViewColumnHeaderEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::DrawListViewColumnHeaderEventHandler ^ DrawColumnHeader;" />
<MemberSignature Language="F#" Value="member this.DrawColumnHeader : System.Windows.Forms.DrawListViewColumnHeaderEventHandler " Usage="member this.DrawColumnHeader : System.Windows.Forms.DrawListViewColumnHeaderEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DrawListViewColumnHeaderEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the details view of a <see cref="T:System.Windows.Forms.ListView" /> is drawn and the <see cref="P:System.Windows.Forms.ListView.OwnerDraw" /> property is set to <see langword="true" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event lets you customize the appearance of a <xref:System.Windows.Forms.ListView> control using owner drawing. It is raised only when the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property is set to `true` and the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details?displayProperty=nameWithType>. This event can occur for each column header in the control. For more information on owner drawing, see the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property reference topic.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example provides an implementation of a <xref:System.Windows.Forms.ListView.DrawColumnHeader> event handler. For the complete example, including the implementation of the <xref:System.Windows.Forms.ListView.DrawSubItem> event handler, see the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> reference topic.
[!code-csharp[ListViewOwnerDraw#5](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewOwnerDraw/CS/listviewownerdraw.cs#5)]
[!code-vb[ListViewOwnerDraw#5](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewOwnerDraw/VB/listviewownerdraw.vb#5)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ColumnHeader" />
<altmember cref="T:System.Windows.Forms.DrawListViewColumnHeaderEventArgs" />
<altmember cref="E:System.Windows.Forms.ListView.DrawItem" />
<altmember cref="E:System.Windows.Forms.ListView.DrawSubItem" />
<altmember cref="P:System.Windows.Forms.ListView.OwnerDraw" />
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="T:System.Windows.Forms.View" />
</Docs>
</Member>
<Member MemberName="DrawItem">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.DrawListViewItemEventHandler DrawItem;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.DrawListViewItemEventHandler DrawItem" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.DrawItem" />
<MemberSignature Language="VB.NET" Value="Public Custom Event DrawItem As DrawListViewItemEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::DrawListViewItemEventHandler ^ DrawItem;" />
<MemberSignature Language="F#" Value="member this.DrawItem : System.Windows.Forms.DrawListViewItemEventHandler " Usage="member this.DrawItem : System.Windows.Forms.DrawListViewItemEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DrawListViewItemEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when a <see cref="T:System.Windows.Forms.ListView" /> is drawn and the <see cref="P:System.Windows.Forms.ListView.OwnerDraw" /> property is set to <see langword="true" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event lets you customize the appearance of a <xref:System.Windows.Forms.ListView> control using owner drawing. It is raised only when the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property is set to `true`. For more information about owner drawing, see the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property reference topic.
The <xref:System.Windows.Forms.ListView.DrawItem> event can occur for each <xref:System.Windows.Forms.ListView> item. When the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details?displayProperty=nameWithType>, the <xref:System.Windows.Forms.ListView.DrawSubItem> and <xref:System.Windows.Forms.ListView.DrawColumnHeader> events also occur. In this case, you can handle the <xref:System.Windows.Forms.ListView.DrawItem> event to draw elements common to all items, such as the background, and handle the <xref:System.Windows.Forms.ListView.DrawSubItem> event to draw elements for individual subitems, such as text values. You can also draw all items in the <xref:System.Windows.Forms.ListView> control using only one of the two events, although this may be less convenient. To draw column headers in the details view, you must handle the <xref:System.Windows.Forms.ListView.DrawColumnHeader> event.
> [!NOTE]
> Because of a bug in the underlying Win32 control, the <xref:System.Windows.Forms.ListView.DrawItem> event occurs without accompanying <xref:System.Windows.Forms.ListView.DrawSubItem> events once per row in the details view when the mouse pointer moves over the row, causing anything painted in a <xref:System.Windows.Forms.ListView.DrawSubItem> event handler to be painted over by a custom background drawn in a <xref:System.Windows.Forms.ListView.DrawItem> event handler. See the example in the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> reference topic for a workaround that invalidates each row when the extra event occurs. An alternative workaround is to put all your custom drawing code in a <xref:System.Windows.Forms.ListView.DrawSubItem> event handler and paint the background for the entire item (including subitems) only when the <xref:System.Windows.Forms.DrawListViewSubItemEventArgs.ColumnIndex%2A?displayProperty=nameWithType> value is 0.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example provides an implementation of a <xref:System.Windows.Forms.ListView.DrawItem> event handler. For the complete example, see the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> reference topic.
[!code-csharp[ListViewOwnerDraw#3](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewOwnerDraw/CS/listviewownerdraw.cs#3)]
[!code-vb[ListViewOwnerDraw#3](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewOwnerDraw/VB/listviewownerdraw.vb#3)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ColumnHeader" />
<altmember cref="T:System.Windows.Forms.DrawListViewItemEventArgs" />
<altmember cref="E:System.Windows.Forms.ListView.DrawSubItem" />
<altmember cref="E:System.Windows.Forms.ListView.DrawColumnHeader" />
<altmember cref="T:System.Windows.Forms.ListViewItem" />
<altmember cref="P:System.Windows.Forms.ListView.OwnerDraw" />
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="T:System.Windows.Forms.View" />
</Docs>
</Member>
<Member MemberName="DrawSubItem">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.DrawListViewSubItemEventHandler DrawSubItem;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.DrawListViewSubItemEventHandler DrawSubItem" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.ListView.DrawSubItem" />
<MemberSignature Language="VB.NET" Value="Public Custom Event DrawSubItem As DrawListViewSubItemEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::DrawListViewSubItemEventHandler ^ DrawSubItem;" />
<MemberSignature Language="F#" Value="member this.DrawSubItem : System.Windows.Forms.DrawListViewSubItemEventHandler " Usage="member this.DrawSubItem : System.Windows.Forms.DrawListViewSubItemEventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.DrawListViewSubItemEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the details view of a <see cref="T:System.Windows.Forms.ListView" /> is drawn and the <see cref="P:System.Windows.Forms.ListView.OwnerDraw" /> property is set to <see langword="true" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This event lets you customize the appearance of a <xref:System.Windows.Forms.ListView> control using owner drawing. It is raised only when the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property is set to `true` and the <xref:System.Windows.Forms.ListView.View%2A> property is set to <xref:System.Windows.Forms.View.Details?displayProperty=nameWithType>. For more information on owner drawing, see the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> property reference topic.
> [!NOTE]
> Subitem information typically appears in the tile view as well as the details view, but in the tile view, it must be drawn in a handler for the <xref:System.Windows.Forms.ListView.DrawItem> event.
The <xref:System.Windows.Forms.ListView.DrawSubItem> event can occur for each <xref:System.Windows.Forms.ListView> subitem. You can handle the <xref:System.Windows.Forms.ListView.DrawItem> event to draw elements common to all subitems, such as the background, and handle the <xref:System.Windows.Forms.ListView.DrawSubItem> event to draw elements for individual subitems, such as text values. You can also draw all items in the <xref:System.Windows.Forms.ListView> control using only one of the two events, although this may be less convenient. To draw column headers in the details view, you must handle the <xref:System.Windows.Forms.ListView.DrawColumnHeader> event.
> [!NOTE]
> The <xref:System.Windows.Forms.ListView.DrawSubItem> event does not occur for any subitems for which no <xref:System.Windows.Forms.ColumnHeader> object has been added to the <xref:System.Windows.Forms.ListView.Columns%2A> collection. Note also that the first subitem of each <xref:System.Windows.Forms.ListViewItem> object represents the parent item itself, and is displayed in the first column.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example provides an implementation of a <xref:System.Windows.Forms.ListView.DrawSubItem> event handler. For the complete example, see the <xref:System.Windows.Forms.ListView.OwnerDraw%2A> reference topic.
[!code-csharp[ListViewOwnerDraw#4](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewOwnerDraw/CS/listviewownerdraw.cs#4)]
[!code-vb[ListViewOwnerDraw#4](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewOwnerDraw/VB/listviewownerdraw.vb#4)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ColumnHeader" />
<altmember cref="T:System.Windows.Forms.DrawListViewSubItemEventArgs" />
<altmember cref="E:System.Windows.Forms.ListView.DrawItem" />
<altmember cref="E:System.Windows.Forms.ListView.DrawColumnHeader" />
<altmember cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" />
<altmember cref="P:System.Windows.Forms.ListView.OwnerDraw" />
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="T:System.Windows.Forms.View" />
</Docs>
</Member>
<Member MemberName="EndUpdate">
<MemberSignature Language="C#" Value="public void EndUpdate ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void EndUpdate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.EndUpdate" />
<MemberSignature Language="VB.NET" Value="Public Sub EndUpdate ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void EndUpdate();" />
<MemberSignature Language="F#" Value="member this.EndUpdate : unit -&gt; unit" Usage="listView.EndUpdate " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Resumes drawing of the list view control after drawing is suspended by the <see cref="M:System.Windows.Forms.ListView.BeginUpdate" /> method.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The preferred way to add multiple items to a <xref:System.Windows.Forms.ListView> is to use the <xref:System.Windows.Forms.ListView.ListViewItemCollection.AddRange%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> (accessed through the <xref:System.Windows.Forms.ListView.Items%2A> property of the <xref:System.Windows.Forms.ListView>). This enables you to add an array of items to the list in a single operation. However, if you want to add items one at a time using the <xref:System.Windows.Forms.ListView.ListViewItemCollection.Add%2A> method of the <xref:System.Windows.Forms.ListView.ListViewItemCollection> class, you can use the <xref:System.Windows.Forms.ListView.BeginUpdate%2A> method to prevent the control from repainting the <xref:System.Windows.Forms.ListView> each time an item is added. Once you have completed the task of adding items to the control, call the <xref:System.Windows.Forms.ListView.EndUpdate%2A> method to enable the <xref:System.Windows.Forms.ListView> to repaint. This way of adding items can prevent flickered drawing of the <xref:System.Windows.Forms.ListView> when a large number of items are being added to the control.
If <xref:System.Windows.Forms.ListView.BeginUpdate%2A> is called more than once, <xref:System.Windows.Forms.ListView.EndUpdate%2A> must be called an equivalent number of times. Until the last call to <xref:System.Windows.Forms.ListView.EndUpdate%2A> the <xref:System.Windows.Forms.ListView> will not repaint. Other than this, multiple calls to <xref:System.Windows.Forms.ListView.BeginUpdate%2A> have no effect.
## Examples
The following code example demonstrates initializing a <xref:System.Windows.Forms.ListView> control to contain check boxes. It also demonstrates using the <xref:System.Windows.Forms.ListView.BeginUpdate%2A> and <xref:System.Windows.Forms.ListView.EndUpdate%2A> methods. To run this example, paste the following code into a form containing a <xref:System.Windows.Forms.ListView> named `ListView1`. Call the `InitializeListView` method from the form's constructor or `Load` method.
[!code-cpp[System.Windows.Forms.ListView2#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView2#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView2/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView2#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView2/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.ListView.BeginUpdate" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.AddRange(System.Windows.Forms.ListViewItem[])" />
<altmember cref="M:System.Windows.Forms.ListView.ListViewItemCollection.Add(System.String)" />
</Docs>
</Member>
<Member MemberName="EnsureVisible">
<MemberSignature Language="C#" Value="public void EnsureVisible (int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void EnsureVisible(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.EnsureVisible(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub EnsureVisible (index As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void EnsureVisible(int index);" />
<MemberSignature Language="F#" Value="member this.EnsureVisible : int -&gt; unit" Usage="listView.EnsureVisible index" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the item to scroll into view.</param>
<summary>Ensures that the specified item is visible within the control, scrolling the contents of the control if necessary.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method to ensure that a specific item is visible within the <xref:System.Windows.Forms.ListView> control. When performing validation on the items in a <xref:System.Windows.Forms.ListView>, you can call the <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method to ensure that an item that failed validation is displayed in the <xref:System.Windows.Forms.ListView> control to allow the user to perform changes on the item. If the item that you want to ensure is visible is located above the viewable region of the <xref:System.Windows.Forms.ListView> control, calling the <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method will scroll the contents of the control until it is the first item in the viewable area of the control. If the item is below the viewable region of the <xref:System.Windows.Forms.ListView> control, calling the <xref:System.Windows.Forms.ListView.EnsureVisible%2A> method will scroll the contents of the <xref:System.Windows.Forms.ListView> control until the item is the last item in the viewable area of the control.
To determine if an item is located at the top of the display area of a <xref:System.Windows.Forms.ListView> control, use the <xref:System.Windows.Forms.ListView.TopItem%2A> property.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.TopItem" />
</Docs>
</Member>
<MemberGroup MemberName="FindItemWithText">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Finds the first <see cref="T:System.Windows.Forms.ListViewItem" /> with that begins with the given text value.</summary>
</Docs>
</MemberGroup>
<Member MemberName="FindItemWithText">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem FindItemWithText (string text);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewItem FindItemWithText(string text) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.FindItemWithText(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function FindItemWithText (text As String) As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewItem ^ FindItemWithText(System::String ^ text);" />
<MemberSignature Language="F#" Value="member this.FindItemWithText : string -&gt; System.Windows.Forms.ListViewItem" Usage="listView.FindItemWithText text" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="text">The text to search for.</param>
<summary>Finds the first <see cref="T:System.Windows.Forms.ListViewItem" /> that begins with the specified text value.</summary>
<returns>The first <see cref="T:System.Windows.Forms.ListViewItem" /> that begins with the specified text value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The search is case-insensitive.
The `text` parameter can specify a substring of the desired matching text. In addition, this method will return the first item that starts with the specified text. For example, if a <xref:System.Windows.Forms.ListView> contains two list items - the first item's text set to "angle bracket" and the second item's text set to "bracket" - a call to <xref:System.Windows.Forms.ListView.FindItemWithText%2A> passing `brack` as the parameter will return the item whose text is "bracket".
The <xref:System.Windows.Forms.ListView.FindItemWithText%2A> method returns `null` if the list is empty or there is no matching item.
## Examples
The following code example demonstrates the <xref:System.Windows.Forms.ListView.FindItemWithText%2A> method. To run this example, paste the following code into a Windows Form and call the `InitializeFindListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler. Click the button to see the results of the method call.
[!code-csharp[System.Windows.Forms.ListViewWhidbeyProperties#3](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/CS/form1.cs#3)]
[!code-vb[System.Windows.Forms.ListViewWhidbeyProperties#3](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb#3)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="FindItemWithText">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem FindItemWithText (string text, bool includeSubItemsInSearch, int startIndex);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewItem FindItemWithText(string text, bool includeSubItemsInSearch, int32 startIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.FindItemWithText(System.String,System.Boolean,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function FindItemWithText (text As String, includeSubItemsInSearch As Boolean, startIndex As Integer) As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewItem ^ FindItemWithText(System::String ^ text, bool includeSubItemsInSearch, int startIndex);" />
<MemberSignature Language="F#" Value="member this.FindItemWithText : string * bool * int -&gt; System.Windows.Forms.ListViewItem" Usage="listView.FindItemWithText (text, includeSubItemsInSearch, startIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="includeSubItemsInSearch" Type="System.Boolean" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="startIndex" Type="System.Int32" Index="2" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="text">The text to search for.</param>
<param name="includeSubItemsInSearch">
<see langword="true" /> to include subitems in the search; otherwise, <see langword="false" />.</param>
<param name="startIndex">The index of the item at which to start the search.</param>
<summary>Finds the first <see cref="T:System.Windows.Forms.ListViewItem" /> or <see cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" />, if indicated, that begins with the specified text value. The search starts at the specified index.</summary>
<returns>The first <see cref="T:System.Windows.Forms.ListViewItem" /> that begins with the specified text value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The search is case-insensitive.
The `text` parameter can specify a substring of the desired matching text. In addition, this method will return the first item that starts with the specified text. For example, if a <xref:System.Windows.Forms.ListView> contains two list items - the first item's text set to "angle bracket" and the second item's text set to "bracket" - a call to <xref:System.Windows.Forms.ListView.FindItemWithText%2A> passing "brack" as the parameter will return the item whose text is "bracket".
The <xref:System.Windows.Forms.ListView.FindItemWithText%2A> method returns `null` if the list is empty or there is no matching item.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="startIndex" /> is less 0 or more than the number items in the <see cref="T:System.Windows.Forms.ListView" />.</exception>
</Docs>
</Member>
<Member MemberName="FindItemWithText">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem FindItemWithText (string text, bool includeSubItemsInSearch, int startIndex, bool isPrefixSearch);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewItem FindItemWithText(string text, bool includeSubItemsInSearch, int32 startIndex, bool isPrefixSearch) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.FindItemWithText(System.String,System.Boolean,System.Int32,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Function FindItemWithText (text As String, includeSubItemsInSearch As Boolean, startIndex As Integer, isPrefixSearch As Boolean) As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewItem ^ FindItemWithText(System::String ^ text, bool includeSubItemsInSearch, int startIndex, bool isPrefixSearch);" />
<MemberSignature Language="F#" Value="member this.FindItemWithText : string * bool * int * bool -&gt; System.Windows.Forms.ListViewItem" Usage="listView.FindItemWithText (text, includeSubItemsInSearch, startIndex, isPrefixSearch)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="text" Type="System.String" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="includeSubItemsInSearch" Type="System.Boolean" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="startIndex" Type="System.Int32" Index="2" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="isPrefixSearch" Type="System.Boolean" Index="3" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="text">The text to search for.</param>
<param name="includeSubItemsInSearch">
<see langword="true" /> to include subitems in the search; otherwise, <see langword="false" />.</param>
<param name="startIndex">The index of the item at which to start the search.</param>
<param name="isPrefixSearch">
<see langword="true" /> to allow partial matches; otherwise, <see langword="false" />.</param>
<summary>Finds the first <see cref="T:System.Windows.Forms.ListViewItem" /> or <see cref="T:System.Windows.Forms.ListViewItem.ListViewSubItem" />, if indicated, that begins with the specified text value. The search starts at the specified index.</summary>
<returns>The first <see cref="T:System.Windows.Forms.ListViewItem" /> that begins with the specified text value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.FindItemWithText%2A> method returns `null` if the list is empty or there is no matching item.
The search is case-insensitive.
The `text` parameter can specify a substring of the desired matching text. This method will return the first item that starts with the specified text, unless `false` is passed in for `isPrefixSearch`. For example, if a <xref:System.Windows.Forms.ListView> contains two list items - the first item's text set to "angle bracket" and the second item's text set to "bracket" - a call to <xref:System.Windows.Forms.ListView.FindItemWithText%2A> passing "brack" as the search text will return the item whose text is "bracket". If `isPrefixSearch` is set to `false`, this call will return `null`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="startIndex" /> is less than 0 or more than the number of items in the <see cref="T:System.Windows.Forms.ListView" />.</exception>
</Docs>
</Member>
<MemberGroup MemberName="FindNearestItem">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Finds the next item from a given point, searching in the specified direction.</summary>
</Docs>
</MemberGroup>
<Member MemberName="FindNearestItem">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem FindNearestItem (System.Windows.Forms.SearchDirectionHint dir, System.Drawing.Point point);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewItem FindNearestItem(valuetype System.Windows.Forms.SearchDirectionHint dir, valuetype System.Drawing.Point point) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.FindNearestItem(System.Windows.Forms.SearchDirectionHint,System.Drawing.Point)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewItem ^ FindNearestItem(System::Windows::Forms::SearchDirectionHint dir, System::Drawing::Point point);" />
<MemberSignature Language="F#" Value="member this.FindNearestItem : System.Windows.Forms.SearchDirectionHint * System.Drawing.Point -&gt; System.Windows.Forms.ListViewItem" Usage="listView.FindNearestItem (dir, point)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dir" Type="System.Windows.Forms.SearchDirectionHint" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="point" Type="System.Drawing.Point" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="dir">One of the <see cref="T:System.Windows.Forms.SearchDirectionHint" /> values.</param>
<param name="point">The point at which to begin searching.</param>
<summary>Finds the next item from the given point, searching in the specified direction</summary>
<returns>The <see cref="T:System.Windows.Forms.ListViewItem" /> that is closest to the given point, searching in the specified direction.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.FindNearestItem%2A> method returns `null` if no item is found in the given direction. Identifying the nearest item can vary depending on the operating system the application is running on, and will affect the results of <xref:System.Windows.Forms.ListView.FindNearestItem%2A>.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.ListView.View" /> is set to a value other than <see cref="F:System.Windows.Forms.View.SmallIcon" /> or <see cref="F:System.Windows.Forms.View.LargeIcon" />.</exception>
</Docs>
</Member>
<Member MemberName="FindNearestItem">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem FindNearestItem (System.Windows.Forms.SearchDirectionHint searchDirection, int x, int y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewItem FindNearestItem(valuetype System.Windows.Forms.SearchDirectionHint searchDirection, int32 x, int32 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.FindNearestItem(System.Windows.Forms.SearchDirectionHint,System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function FindNearestItem (searchDirection As SearchDirectionHint, x As Integer, y As Integer) As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewItem ^ FindNearestItem(System::Windows::Forms::SearchDirectionHint searchDirection, int x, int y);" />
<MemberSignature Language="F#" Value="member this.FindNearestItem : System.Windows.Forms.SearchDirectionHint * int * int -&gt; System.Windows.Forms.ListViewItem" Usage="listView.FindNearestItem (searchDirection, x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="searchDirection" Type="System.Windows.Forms.SearchDirectionHint" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="x" Type="System.Int32" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="y" Type="System.Int32" Index="2" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="searchDirection">One of the <see cref="T:System.Windows.Forms.SearchDirectionHint" /> values.</param>
<param name="x">The x-coordinate for the point at which to begin searching.</param>
<param name="y">The y-coordinate for the point at which to begin searching.</param>
<summary>Finds the next item from the given x- and y-coordinates, searching in the specified direction.</summary>
<returns>The <see cref="T:System.Windows.Forms.ListViewItem" /> that is closest to the given coordinates, searching in the specified direction.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.FindNearestItem%2A> method returns `null` if no item is found in the given direction. Identifying the nearest item can vary depending on the operating system the application is running on, and will affect the results of <xref:System.Windows.Forms.ListView.FindNearestItem%2A>.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Forms.ListView.View" /> is set to a value other than <see cref="F:System.Windows.Forms.View.SmallIcon" /> or <see cref="F:System.Windows.Forms.View.LargeIcon" />.</exception>
</Docs>
</Member>
<Member MemberName="FocusedItem">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem FocusedItem { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ListViewItem FocusedItem" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.FocusedItem" />
<MemberSignature Language="VB.NET" Value="Public Property FocusedItem As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ListViewItem ^ FocusedItem { System::Windows::Forms::ListViewItem ^ get(); void set(System::Windows::Forms::ListViewItem ^ value); };" />
<MemberSignature Language="F#" Value="member this.FocusedItem : System.Windows.Forms.ListViewItem with get, set" Usage="System.Windows.Forms.ListView.FocusedItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the item in the control that currently has focus.</summary>
<value>A <see cref="T:System.Windows.Forms.ListViewItem" /> that represents the item that has focus, or <see langword="null" /> if no item has the focus in the <see cref="T:System.Windows.Forms.ListView" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.FocusedItem%2A> property returns the <xref:System.Windows.Forms.ListViewItem> that represents the item currently displaying the focus rectangle for the <xref:System.Windows.Forms.ListView> control. Because a <xref:System.Windows.Forms.ListView> control has no directly editable areas other than the items it displays, when the <xref:System.Windows.Forms.ListView> control has focus, an item within the <xref:System.Windows.Forms.ListView> displays the focus reticle around its item text. Typically, the last selected item in the <xref:System.Windows.Forms.ListView> control is the item with focus. Although an item may be the one displaying the focus reticle, it may not actually be a selected item in the <xref:System.Windows.Forms.ListView>. Use the <xref:System.Windows.Forms.ListView.SelectedItems%2A> or <xref:System.Windows.Forms.ListView.SelectedIndices%2A> properties to obtain the selected items in the <xref:System.Windows.Forms.ListView> control, the <xref:System.Windows.Forms.ListView.FocusedItem%2A> property is not necessarily selected. You can use the <xref:System.Windows.Forms.ListView.FocusedItem%2A> property to determine which item was last clicked in the <xref:System.Windows.Forms.ListView> control, regardless of selection state.
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListViewItem" />
</Docs>
</Member>
<Member MemberName="ForeColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color ForeColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color ForeColor" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.ForeColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property ForeColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color ForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.ForeColor : System.Drawing.Color with get, set" Usage="System.Windows.Forms.ListView.ForeColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the foreground color.</summary>
<value>The <see cref="T:System.Drawing.Color" /> that is the foreground color.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="FullRowSelect">
<MemberSignature Language="C#" Value="public bool FullRowSelect { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool FullRowSelect" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.FullRowSelect" />
<MemberSignature Language="VB.NET" Value="Public Property FullRowSelect As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool FullRowSelect { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.FullRowSelect : bool with get, set" Usage="System.Windows.Forms.ListView.FullRowSelect" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether clicking an item selects all its subitems.</summary>
<value>
<see langword="true" /> if clicking an item selects the item and all its subitems; <see langword="false" /> if clicking an item selects only the item itself. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.FullRowSelect%2A> property has no effect unless the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control is set to <xref:System.Windows.Forms.View.Details>. The <xref:System.Windows.Forms.ListView.FullRowSelect%2A> property is typically used when a <xref:System.Windows.Forms.ListView> displays items with many subitems and it is important to be able to see selected items when the item text is not visible due to horizontal scrolling of the control's contents.
> [!NOTE]
> When <xref:System.Windows.Forms.ListView.FullRowSelect%2A> is set to `true`, ToolTips for a <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> will not be shown; only the ToolTip for the parent <xref:System.Windows.Forms.ListViewItem> is displayed.
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control.
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="F:System.Windows.Forms.View.Details" />
</Docs>
</Member>
<Member MemberName="GetItemAt">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewItem GetItemAt (int x, int y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewItem GetItemAt(int32 x, int32 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.GetItemAt(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function GetItemAt (x As Integer, y As Integer) As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewItem ^ GetItemAt(int x, int y);" />
<MemberSignature Language="F#" Value="member this.GetItemAt : int * int -&gt; System.Windows.Forms.ListViewItem" Usage="listView.GetItemAt (x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Int32" />
<Parameter Name="y" Type="System.Int32" />
</Parameters>
<Docs>
<param name="x">The x-coordinate of the location to search for an item (expressed in client coordinates).</param>
<param name="y">The y-coordinate of the location to search for an item (expressed in client coordinates).</param>
<summary>Retrieves the item at the specified location.</summary>
<returns>A <see cref="T:System.Windows.Forms.ListViewItem" /> that represents the item at the specified position. If there is no item at the specified location, the method returns <see langword="null" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.GetItemAt%2A> method lets you determine which item is located at a specific location within the client region of the <xref:System.Windows.Forms.ListView> control. You can use this method when the user clicks or right-clicks a subitem (when the <xref:System.Windows.Forms.ListView.View%2A> property is set to `View.Details`) and you want to determine which item owns the subitem that was clicked based on the mouse coordinates at the time the user clicked the mouse.
> [!NOTE]
> When the <xref:System.Windows.Forms.ListView.FullRowSelect%2A> property value is `false`, this method returns an item only when the specified location is within the bounds of the parent item (which is displayed in the first column when the control is in details mode). You must set the <xref:System.Windows.Forms.ListView.FullRowSelect%2A> property to `true` to retrieve an item with this method given a location within the bounds of a subitem. You can also use the <xref:System.Windows.Forms.ListView.HitTest%2A> method to retrieve detailed information about the item at a particular location.
To do drag-and-drop repositioning of items within a <xref:System.Windows.Forms.ListView>, you might want to use the <xref:System.Windows.Forms.ListViewInsertionMark.NearestIndex%2A?displayProperty=nameWithType> method rather than the <xref:System.Windows.Forms.ListView.GetItemAt%2A> method. The <xref:System.Windows.Forms.ListViewInsertionMark.NearestIndex%2A?displayProperty=nameWithType> method finds the closest item regardless of where the mouse pointer is located. The <xref:System.Windows.Forms.ListView.GetItemAt%2A> method, on the other hand, returns `null` if there is no item at the specified location.
> [!NOTE]
> The <xref:System.Windows.Forms.ListViewInsertionMark> class is supported only on Windows XP and Windows Server 2003 when your application calls the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method.
## Examples
The following code example demonstrates the use of the <xref:System.Windows.Forms.PictureBox> and <xref:System.Windows.Forms.ListView> controls. The <xref:System.Windows.Forms.PictureBox> is initialized by setting the <xref:System.Windows.Forms.PictureBox.BorderStyle%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.PictureBox.SizeMode%2A?displayProperty=nameWithType> properties using the <xref:System.Windows.Forms.BorderStyle> and <xref:System.Windows.Forms.PictureBoxSizeMode> enumerations, respectively. The <xref:System.Windows.Forms.ListView> is populated with pictures from the Samples directory. The <xref:System.Windows.Forms.ListView.GetItemAt%2A> method is used in when handling the <xref:System.Windows.Forms.ListView> control's <xref:System.Windows.Forms.Control.MouseDown> event to determine whether an item is selected. If an item is selected, the event handler displays the selected file by setting the <xref:System.Windows.Forms.PictureBox.Image%2A?displayProperty=nameWithType> property. The example requires the existence of JPG files located in the C:\documents and Settings\All Users\Documents\My Pictures\Sample Pictures directory. To run this example, paste the code into a form and call the `InitializePictureBox` and `PopulateListView` methods in the form's constructor or `Load` method. Ensure all events are associated with their event handlers.
[!code-cpp[System.Windows.Forms.ListViewAndPictureBox#2](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewAndPictureBox/CPP/form1.cpp#2)]
[!code-csharp[System.Windows.Forms.ListViewAndPictureBox#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewAndPictureBox/CS/form1.cs#2)]
[!code-vb[System.Windows.Forms.ListViewAndPictureBox#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewAndPictureBox/VB/form1.vb#2)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Forms.Control.PointToScreen(System.Drawing.Point)" />
<altmember cref="M:System.Windows.Forms.Control.PointToClient(System.Drawing.Point)" />
<altmember cref="T:System.Windows.Forms.ListViewInsertionMark" />
<altmember cref="T:System.Windows.Forms.ListViewItem" />
<altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" />
</Docs>
</Member>
<MemberGroup MemberName="GetItemRect">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Retrieves the bounding rectangle for an item within the control.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetItemRect">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle GetItemRect (int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Drawing.Rectangle GetItemRect(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.GetItemRect(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function GetItemRect (index As Integer) As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Drawing::Rectangle GetItemRect(int index);" />
<MemberSignature Language="F#" Value="member this.GetItemRect : int -&gt; System.Drawing.Rectangle" Usage="listView.GetItemRect index" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the item within the <see cref="T:System.Windows.Forms.ListView.ListViewItemCollection" /> whose bounding rectangle you want to return.</param>
<summary>Retrieves the bounding rectangle for a specific item within the list view control.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounding rectangle of the specified <see cref="T:System.Windows.Forms.ListViewItem" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The bounding rectangle returned by this version of the <xref:System.Windows.Forms.ListView.GetItemRect%2A> method represents the entire item, including the icon, item text, and subitem text. To specify a specific portion of the item's bounding rectangle, use the other version of the <xref:System.Windows.Forms.ListView.GetItemRect%2A> method.
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Rectangle" />
<altmember cref="T:System.Windows.Forms.ListViewItem" />
</Docs>
</Member>
<Member MemberName="GetItemRect">
<MemberSignature Language="C#" Value="public System.Drawing.Rectangle GetItemRect (int index, System.Windows.Forms.ItemBoundsPortion portion);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance valuetype System.Drawing.Rectangle GetItemRect(int32 index, valuetype System.Windows.Forms.ItemBoundsPortion portion) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.GetItemRect(System.Int32,System.Windows.Forms.ItemBoundsPortion)" />
<MemberSignature Language="VB.NET" Value="Public Function GetItemRect (index As Integer, portion As ItemBoundsPortion) As Rectangle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Drawing::Rectangle GetItemRect(int index, System::Windows::Forms::ItemBoundsPortion portion);" />
<MemberSignature Language="F#" Value="member this.GetItemRect : int * System.Windows.Forms.ItemBoundsPortion -&gt; System.Drawing.Rectangle" Usage="listView.GetItemRect (index, portion)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Rectangle</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
<Parameter Name="portion" Type="System.Windows.Forms.ItemBoundsPortion" />
</Parameters>
<Docs>
<param name="index">The zero-based index of the item within the <see cref="T:System.Windows.Forms.ListView.ListViewItemCollection" /> whose bounding rectangle you want to return.</param>
<param name="portion">One of the <see cref="T:System.Windows.Forms.ItemBoundsPortion" /> values that represents a portion of the <see cref="T:System.Windows.Forms.ListViewItem" /> for which to retrieve the bounding rectangle.</param>
<summary>Retrieves the specified portion of the bounding rectangle for a specific item within the list view control.</summary>
<returns>A <see cref="T:System.Drawing.Rectangle" /> that represents the bounding rectangle for the specified portion of the specified <see cref="T:System.Windows.Forms.ListViewItem" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The bounding rectangle returned by this version of the <xref:System.Windows.Forms.ListView.GetItemRect%2A> method represents only the section of the item specified in the `portion` parameter. To return the bounding rectangle of the entire item, use the other version of the <xref:System.Windows.Forms.ListView.GetItemRect%2A> method.
]]></format>
</remarks>
<altmember cref="T:System.Drawing.Rectangle" />
<altmember cref="T:System.Windows.Forms.ListViewItem" />
<altmember cref="T:System.Windows.Forms.ItemBoundsPortion" />
</Docs>
</Member>
<Member MemberName="GridLines">
<MemberSignature Language="C#" Value="public bool GridLines { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool GridLines" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.GridLines" />
<MemberSignature Language="VB.NET" Value="Public Property GridLines As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool GridLines { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.GridLines : bool with get, set" Usage="System.Windows.Forms.ListView.GridLines" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether grid lines appear between the rows and columns containing the items and subitems in the control.</summary>
<value>
<see langword="true" /> if grid lines are drawn around items and subitems; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.GridLines%2A> property has no effect unless the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control is set to <xref:System.Windows.Forms.View.Details>. The <xref:System.Windows.Forms.ListView.GridLines%2A> property allows you to display lines to identify the rows and columns that are displayed in the <xref:System.Windows.Forms.ListView> control when it displays items and their subitems. The grid lines that are displayed do not provide the ability to resize rows and columns as an application such as Microsoft Excel does. Only columns can be resized, if column headers are displayed, by moving the mouse pointer to the right side of the column to resize and then clicking and dragging until the column is the size you want. The grid lines feature is used to provide the user of the control with visible boundaries around items and subitems.
## Examples
The following code example creates a <xref:System.Windows.Forms.ListView> control with three <xref:System.Windows.Forms.ListViewItem> objects specified and three <xref:System.Windows.Forms.ListViewItem.ListViewSubItem> objects specified for each item. The example also creates <xref:System.Windows.Forms.ColumnHeader> objects to display the subitems in details view. Two <xref:System.Windows.Forms.ImageList> objects are also created in the code example to provide images for the <xref:System.Windows.Forms.ListViewItem> objects. These <xref:System.Windows.Forms.ImageList> objects are added to the <xref:System.Windows.Forms.ListView.LargeImageList%2A> and <xref:System.Windows.Forms.ListView.SmallImageList%2A> properties. The example uses the following properties in creating the <xref:System.Windows.Forms.ListView> control.
- <xref:System.Windows.Forms.ListView.View%2A>
- <xref:System.Windows.Forms.ListView.LabelEdit%2A>
- <xref:System.Windows.Forms.ListView.AllowColumnReorder%2A>
- <xref:System.Windows.Forms.ListView.CheckBoxes%2A>
- <xref:System.Windows.Forms.ListView.FullRowSelect%2A>
- <xref:System.Windows.Forms.ListView.GridLines%2A>
- <xref:System.Windows.Forms.ListView.Sorting%2A>
This example requires that you have added the code to a <xref:System.Windows.Forms.Form> and call the method created in the example from the constructor or another method on the form. The example also requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C.
[!code-cpp[ListViewExample#1](~/samples/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp#1)]
[!code-csharp[ListViewExample#1](~/samples/snippets/csharp/VS_Snippets_Winforms/ListViewExample/CS/form1.cs#1)]
[!code-vb[ListViewExample#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.ListView.View" />
</Docs>
</Member>
<Member MemberName="Groups">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewGroupCollection Groups { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ListViewGroupCollection Groups" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.Groups" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Groups As ListViewGroupCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ListViewGroupCollection ^ Groups { System::Windows::Forms::ListViewGroupCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Groups : System.Windows.Forms.ListViewGroupCollection" Usage="System.Windows.Forms.ListView.Groups" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ListViewGroupCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.MergableProperty(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.ListViewGroupCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewGroupCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the collection of <see cref="T:System.Windows.Forms.ListViewGroup" /> objects assigned to the control.</summary>
<value>A <see cref="T:System.Windows.Forms.ListViewGroupCollection" /> that contains all the groups in the <see cref="T:System.Windows.Forms.ListView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView> grouping feature lets you create visual groups of logically related <xref:System.Windows.Forms.ListView> items. Each group consists of a textual header followed by a horizontal line and the items assigned to that group. You can align the header text to the left, right, or center of the control. Any groups assigned to a <xref:System.Windows.Forms.ListView> control appear whenever the <xref:System.Windows.Forms.ListView.View%2A> property is set to a value other than <xref:System.Windows.Forms.View.List?displayProperty=nameWithType>.
<xref:System.Windows.Forms.ListView> groups help your users find the items they are looking for by separating the items into useful categories. You can create whatever categories you need. One typical approach is to group the items based on the way the list is sorted. For example, you can group the items by the initial letter of the item name when the list is sorted alphabetically or by subitems such as type or date when the list is sorted by clicking a column header in the details view. Windows Explorer uses this type of grouping.
To use the grouping feature, add one or more <xref:System.Windows.Forms.ListViewGroup> objects to the <xref:System.Windows.Forms.ListView.Groups%2A> collection of a <xref:System.Windows.Forms.ListView> control. Set the group header text and header alignment in the <xref:System.Windows.Forms.ListViewGroup.%23ctor%2A> constructor, or set them using the <xref:System.Windows.Forms.ListViewGroup.Header%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ListViewGroup.HeaderAlignment%2A?displayProperty=nameWithType> properties.
To temporarily disable the grouping feature, set the <xref:System.Windows.Forms.ListView.ShowGroups%2A> property to `false`.
You can assign an item to a group by specifying the group in the <xref:System.Windows.Forms.ListViewItem.%23ctor%2A> constructor, by setting the <xref:System.Windows.Forms.ListViewItem.Group%2A?displayProperty=nameWithType> property, or by directly adding the item to the <xref:System.Windows.Forms.ListViewGroup.Items%2A?displayProperty=nameWithType> collection of a group. All items should be assigned to groups before they are displayed. Any items that are not assigned to a group will appear in the default group, which has the header label "DefaultGroup{0}". The default group is not contained in the <xref:System.Windows.Forms.ListView.Groups%2A> collection, and cannot be altered. It is primarily useful in debugging to ensure that all items have been properly added to groups.
An item can only be in one group at a time. You can change the group to which an item belongs by setting the <xref:System.Windows.Forms.ListViewItem.Group%2A?displayProperty=nameWithType> property at run time or by adding it to the <xref:System.Windows.Forms.ListViewGroup.Items%2A?displayProperty=nameWithType> collection of another group, which automatically removes it from the previous group.
The insertion mark feature is disabled when using groups. This is because the grouping feature orders items by group membership, while the insertion mark feature is used with drag-and-drop repositioning in a <xref:System.Windows.Forms.ListView> control that does not already order its items.
<xref:System.Windows.Forms.ListView> groups are available only on Windows XP and Windows Server 2003 when your application calls the <xref:System.Windows.Forms.Application.EnableVisualStyles%2A?displayProperty=nameWithType> method. On earlier operating systems, any code relating to groups has no effect and the groups will not appear. As a result, any code that depends on the grouping feature might not work correctly.
You might want to include code that determines whether the grouping feature is available, and provide alternate functionality when it is unavailable. For example, you might want to provide alternate sorting when running on operating systems that do not support sorting by group.
The grouping feature is provided by the same library that provides the operating system themes feature. To check for the availability of this library, call the <xref:System.Windows.Forms.FeatureSupport.IsPresent%28System.Object%29?displayProperty=nameWithType> method overload and pass in the <xref:System.Windows.Forms.OSFeature.Themes?displayProperty=nameWithType> value.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.ListView> grouping feature to organize items by subitem value in the details view. This form of grouping is similar to the grouping used in Windows Explorer. In the example, the groups are created dynamically. For each subitem column, one group is created for each unique subitem value. For the parent item column, one group is created for each unique initial letter. Clicking the header of a column sorts the items into the groups created for that column. Clicking the same column header again reverses the order of the groups.
[!code-cpp[System.Windows.Forms.ListView.Groups#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/CPP/listviewgroupsexample.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView.Groups#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/CS/listviewgroupsexample.cs#1)]
[!code-vb[System.Windows.Forms.ListView.Groups#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/VB/listviewgroupsexample.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ListViewGroup" />
<altmember cref="T:System.Windows.Forms.ListViewGroupCollection" />
<altmember cref="T:System.Windows.Forms.ListViewItem" />
<altmember cref="P:System.Windows.Forms.ListView.ShowGroups" />
<altmember cref="M:System.Windows.Forms.Application.EnableVisualStyles" />
</Docs>
</Member>
<Member MemberName="HeaderStyle">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ColumnHeaderStyle HeaderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.ColumnHeaderStyle HeaderStyle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.HeaderStyle" />
<MemberSignature Language="VB.NET" Value="Public Property HeaderStyle As ColumnHeaderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::ColumnHeaderStyle HeaderStyle { System::Windows::Forms::ColumnHeaderStyle get(); void set(System::Windows::Forms::ColumnHeaderStyle value); };" />
<MemberSignature Language="F#" Value="member this.HeaderStyle : System.Windows.Forms.ColumnHeaderStyle with get, set" Usage="System.Windows.Forms.ListView.HeaderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.ColumnHeaderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the column header style.</summary>
<value>One of the <see cref="T:System.Windows.Forms.ColumnHeaderStyle" /> values. The default is <see cref="F:System.Windows.Forms.ColumnHeaderStyle.Clickable" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property allows you to specify the type of column headers to display when the <xref:System.Windows.Forms.ListView.View%2A> property of the <xref:System.Windows.Forms.ListView> control is set to <xref:System.Windows.Forms.View.Details> and the <xref:System.Windows.Forms.ListView> control has <xref:System.Windows.Forms.ColumnHeader> objects specified in the <xref:System.Windows.Forms.ListView.ColumnHeaderCollection>. <xref:System.Windows.Forms.ColumnHeader> objects define the columns that are displayed in the <xref:System.Windows.Forms.ListView> control. Each column is used to display subitem information for each item in the <xref:System.Windows.Forms.ListView>.
The <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property allows you to specify whether the column headers are visible or, if they are visible, whether they will function as clickable buttons. If the <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property is set to <xref:System.Windows.Forms.ColumnHeaderStyle.None?displayProperty=nameWithType>, the column headers are not displayed, although the items and subitems of the <xref:System.Windows.Forms.ListView> control are still arranged in columns. If the <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property is set to <xref:System.Windows.Forms.ColumnHeaderStyle.Clickable?displayProperty=nameWithType>, the column headers act like buttons that users can click to carry out an action, such as sorting the items in the <xref:System.Windows.Forms.ListView> control using the items in the clicked column as a key. You can implement this behavior in a handler for the <xref:System.Windows.Forms.ListView.ColumnClick> event. If the <xref:System.Windows.Forms.ListView.HeaderStyle%2A> property is set to <xref:System.Windows.Forms.ColumnHeaderStyle.Nonclickable?displayProperty=nameWithType>, the column headers appear, but cannot be clicked.
## Examples
The following code example demonstrates a <xref:System.Windows.Forms.ListView> that allows multiple items to be selected. The example demonstrates setting the <xref:System.Windows.Forms.ListView.HideSelection%2A> and <xref:System.Windows.Forms.ListView.HeaderStyle%2A> properties. It also demonstrates the <xref:System.Windows.Forms.ColumnHeader.Text%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.ColumnHeader.TextAlign%2A?displayProperty=nameWithType> and <xref:System.Windows.Forms.ColumnHeader.Width%2A?displayProperty=nameWithType> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> object named `ListView1` and a <xref:System.Windows.Forms.TextBox> named `TextBox1`. Call the `InitializeListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-cpp[System.Windows.Forms.ListView1#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView1/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView1#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView1/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView1#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView1/VB/form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value specified is not one of the <see cref="T:System.Windows.Forms.ColumnHeaderStyle" /> values.</exception>
<altmember cref="E:System.Windows.Forms.ListView.ColumnClick" />
<altmember cref="T:System.Windows.Forms.ColumnHeaderStyle" />
<altmember cref="P:System.Windows.Forms.ListView.View" />
<altmember cref="T:System.Windows.Forms.View" />
</Docs>
</Member>
<Member MemberName="HideSelection">
<MemberSignature Language="C#" Value="public bool HideSelection { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HideSelection" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.HideSelection" />
<MemberSignature Language="VB.NET" Value="Public Property HideSelection As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HideSelection { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.HideSelection : bool with get, set" Usage="System.Windows.Forms.ListView.HideSelection" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the selected item in the control remains highlighted when the control loses focus.</summary>
<value>
<see langword="true" /> if the selected item does not appear highlighted when the control loses focus; <see langword="false" /> if the selected item still appears highlighted when the control loses focus. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When this property is set to `false`, selected items in the <xref:System.Windows.Forms.ListView> control remain highlighted in a different color than the current selection color specified by the operating system when the <xref:System.Windows.Forms.ListView> control loses focus. You can use this property to keep items that are selected by the user visible when the user clicks a different control on the form or moves to a different window.
> [!NOTE]
> If you are concerned with the accessibility of your applications, it is recommended that you set the <xref:System.Windows.Forms.ListView.HideSelection%2A> property to `false`.
## Examples
The following code example demonstrates a <xref:System.Windows.Forms.ListView> that allows multiple items to be selected. The example demonstrates setting the <xref:System.Windows.Forms.ListView.HideSelection%2A> and <xref:System.Windows.Forms.ListView.HeaderStyle%2A> properties. It also demonstrates the <xref:System.Windows.Forms.ColumnHeader.Text%2A?displayProperty=nameWithType>, <xref:System.Windows.Forms.ColumnHeader.TextAlign%2A?displayProperty=nameWithType>, and <xref:System.Windows.Forms.ColumnHeader.Width%2A?displayProperty=nameWithType> properties. To run this example, paste the following code into a form that contains a <xref:System.Windows.Forms.ListView> object named `ListView1` and a <xref:System.Windows.Forms.TextBox> named `TextBox1`. Call the `InitializeListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-cpp[System.Windows.Forms.ListView1#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView1/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.ListView1#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListView1/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.ListView1#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView1/VB/form1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="HitTest">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Provides item information, given an x- and y-coordinate.</summary>
</Docs>
</MemberGroup>
<Member MemberName="HitTest">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewHitTestInfo HitTest (System.Drawing.Point point);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewHitTestInfo HitTest(valuetype System.Drawing.Point point) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.HitTest(System.Drawing.Point)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewHitTestInfo ^ HitTest(System::Drawing::Point point);" />
<MemberSignature Language="F#" Value="member this.HitTest : System.Drawing.Point -&gt; System.Windows.Forms.ListViewHitTestInfo" Usage="listView.HitTest point" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewHitTestInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="point" Type="System.Drawing.Point" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="point">The <see cref="T:System.Drawing.Point" /> at which to retrieve the item information. The coordinates are relative to the upper-left corner of the control.</param>
<summary>Provides item information, given a point.</summary>
<returns>The item information, given a point.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this method to determine whether a point is in an item or subitem and where in the item the point is located, such as on the label or image area. If the coordinates are located outside the control, the returned <xref:System.Windows.Forms.ListViewHitTestInfo> object has a <xref:System.Windows.Forms.ListViewHitTestInfo.Location%2A> property of "None"; and the <xref:System.Windows.Forms.ListViewHitTestInfo.Item%2A> and <xref:System.Windows.Forms.ListViewHitTestInfo.SubItem%2A> properties are set to `null`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The point contains coordinates that are less than 0.</exception>
</Docs>
</Member>
<Member MemberName="HitTest">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewHitTestInfo HitTest (int x, int y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Windows.Forms.ListViewHitTestInfo HitTest(int32 x, int32 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.ListView.HitTest(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Function HitTest (x As Integer, y As Integer) As ListViewHitTestInfo" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::Windows::Forms::ListViewHitTestInfo ^ HitTest(int x, int y);" />
<MemberSignature Language="F#" Value="member this.HitTest : int * int -&gt; System.Windows.Forms.ListViewHitTestInfo" Usage="listView.HitTest (x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.ListViewHitTestInfo</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Int32" Index="0" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="y" Type="System.Int32" Index="1" FrameworkAlternate="netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="x">The x-coordinate at which to retrieve the item information. The coordinate is relative to the upper-left corner of the control.</param>
<param name="y">The y-coordinate at which to retrieve the item information. The coordinate is relative to the upper-left corner of the control.</param>
<summary>Provides item information, given x- and y-coordinates.</summary>
<returns>The item information, given x- and y- coordinates.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this method to determine whether a point is in an item or subitem, and where in the item the point is located, such as on the label or image area. If the coordinates are located outside the control, the returned <xref:System.Windows.Forms.ListViewHitTestInfo> object has a <xref:System.Windows.Forms.ListViewHitTestInfo.Location%2A> property of "None"; and the <xref:System.Windows.Forms.ListViewHitTestInfo.Item%2A> and <xref:System.Windows.Forms.ListViewHitTestInfo.SubItem%2A> properties are set to `null`.
## Examples
The following code example demonstrates using the <xref:System.Windows.Forms.ListView.HitTest%2A> method to determine the location of a mouse event in a <xref:System.Windows.Forms.ListView>. To run this example, paste it into a Windows Form that contains a <xref:System.Windows.Forms.ListView> named `listView1` that is populated with items. Associate the <xref:System.Windows.Forms.Control.MouseDown> event for `listView1` with the `listView1_MouseDown` method in this example.
[!code-csharp[System.Windows.Forms.ListViewWhidbeyProperties#7](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/CS/form1.cs#7)]
[!code-vb[System.Windows.Forms.ListViewWhidbeyProperties#7](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb#7)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The x- or y-coordinate is less than 0.</exception>
</Docs>
</Member>
<Member MemberName="HotTracking">
<MemberSignature Language="C#" Value="public bool HotTracking { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HotTracking" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.HotTracking" />
<MemberSignature Language="VB.NET" Value="Public Property HotTracking As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HotTracking { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.HotTracking : bool with get, set" Usage="System.Windows.Forms.ListView.HotTracking" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the text of an item or subitem has the appearance of a hyperlink when the mouse pointer passes over it.</summary>
<value>
<see langword="true" /> if the item text has the appearance of a hyperlink when the mouse passes over it; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Enabling hot tracking will cause the <xref:System.Windows.Forms.ListView.Activation%2A> property to be set to <xref:System.Windows.Forms.ItemActivation.OneClick> and the <xref:System.Windows.Forms.ListView.HoverSelection%2A> property to be set to `true`. In addition, run-time label editing is not allowed when hot tracking is enabled.
## Examples
The following code example demonstrates a <xref:System.Windows.Forms.ListView> with hot tracking enabled. To run this example, paste the following code into a Windows Form and call the `InitializeHotTrackingListView` method from the form's constructor or <xref:System.Windows.Forms.Form.Load> event handler.
[!code-csharp[System.Windows.Forms.ListViewWhidbeyProperties#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/CS/form1.cs#2)]
[!code-vb[System.Windows.Forms.ListViewWhidbeyProperties#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewWhidbeyProperties/VB/form1.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="HoverSelection">
<MemberSignature Language="C#" Value="public bool HoverSelection { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HoverSelection" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.ListView.HoverSelection" />
<MemberSignature Language="VB.NET" Value="Public Property HoverSelection As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool HoverSelection { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.HoverSelection : bool with get, set" Usage="System.Windows.Forms.ListView.HoverSelection" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether an item is automatically selected when the mouse pointer remains over the item for a few seconds.</summary>
<value>
<see langword="true" /> if an item is automatically selected when the mouse pointer hovers over it; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When this property is set to `true`, the user can point to an item in the <xref:System.Windows.Forms.ListView> control to select the item. Multiple items can be selected (when the <xref:System.Windows.Forms.ListView.MultiSelect%2A> property is set to true) by holding down the CTRL key while pointing to each item. You can use this feature to provide an easier method for the user of your application to select items in the <xref:System.Windows.Forms.ListView> control.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="InsertionMark">
<MemberSignature Language="C#" Value="public System.Windows.Forms.ListViewInsertionMark InsertionMark { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.ListViewInsertionMark InsertionMark" />
<MemberSignature