-
Hi There,
I have a listview object and want to know 3 things.. With my listview object i have 3 columns. Is there a way to stop the columns from being resized? Also is there a way to find out which item (row) is selected? Also is there a way to find out when an row is selected, all the data from the columns that are on the row? If you can help me it would be great! Thanks!
-
Not sure about locking columns but for the other two try this
Code:
Private Sub Command1_Click()
Dim i As Integer
Dim iColumnCount As Integer
Dim sRowText As String
'Check if a row is selected
If Not ListView1.SelectedItem Is Nothing Then
'Subtract 1 because first column is the text field
iColumnCount = ListView1.ColumnHeaders.Count - 1
sRowText = ListView1.SelectedItem.Text
'Get data from each subitem
For i = 1 To iColumnCount
sRowText = sRowText & ListView1.SelectedItem.SubItems(i)
Next i
MsgBox "Text in select row: " & sRowText
Else
MsgBox "No row selected"
End If
End Sub