ListViewHitTestInfo Class
TOC
Collapse the table of content
Expand the table of content

ListViewHitTestInfo Class

 

Contains information about an area of a ListView control or a ListViewItem.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

System.Object
  System.Windows.Forms.ListViewHitTestInfo

public class ListViewHitTestInfo

NameDescription
System_CAPS_pubmethodListViewHitTestInfo(ListViewItem, ListViewItem.ListViewSubItem, ListViewHitTestLocations)

Initializes a new instance of the ListViewHitTestInfo class.

NameDescription
System_CAPS_pubpropertyItem

Gets the ListViewItem at the position indicated by a hit test on a ListView.

System_CAPS_pubpropertyLocation

Gets the location of a hit test on a ListView control, in relation to the ListView and the items it contains.

System_CAPS_pubpropertySubItem

Gets the ListViewItem.ListViewSubItem at the position indicated by a hit test on a ListView.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

ListViewHitTestInfo is returned by the ListView class when the HitTest method is called.

The following code example demonstrates using the ListViewHitTestInfo class and the HitTest method to determine the location of a MouseDown event. To run this code, paste it into a Windows Form that contains a ListView named listView1 that is populated with items. Associate the MouseDown event for the form and listView1 with the HandleMouseDown method in this example.

void HandleMouseDown(object sender, MouseEventArgs e)
{
    ListViewHitTestInfo info = listView1.HitTest(e.X, e.Y);
    MessageBox.Show(info.Location.ToString());
}

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft