' Get the horizontal scroll bar's position.
Public Function GetListViewColumn(ByVal lvw As ListView, _ ' Return the column under this X position. The GetListViewColumn function shown in the following code finds the column that contains a specific X position. When it finds the row that contains the point, it saves the row number and calls GetListViewColumn to find the column at that point. The code loops through the control's items (rows), checking to see whether an item's bounds contain the point. If lvw.Items(i).Bounds.Contains(x, y) Then Row As Integer, ByRef column As Integer) As Booleanįor i As Integer = 0 To - 1 ListView, ByVal x As Integer, ByVal y As Integer, ByRef _ Public Function FindListViewRowColumn(ByVal lvw As _ ' Return False if the mouse is not under a ListView cell. The FindListViewRowColumn function shown in the following code finds the row and column under the mouse. There are three interesting pieces to this example. You could modify the program to display the row and column when you click on the control. When you move the mouse over the program's ListView control, it displays the index of the row and column under the mouse. ListView, row, column, mouse, click, Visual Basic.
This example shows how to determine which ListView row and column are under the mouse in Visual Basic. NETÄetermine which ListView row and column are under the mouse in Visual Basic. VB Helper: HowTo: Determine which ListView row and column are under the mouse in Visual Basic.