flann Posted August 17, 2005 Posted August 17, 2005 (edited) [PLAIN]listview Selecteditem [RESOLVED][/PLAIN] does anybody know how I can get the index of a selected item in a listview? Edited August 17, 2005 by flann Quote Flann Mortgage Calculator | Debt Free Credit Card Debt | Filing Bankruptcy
Administrators PlausiblyDamp Posted August 17, 2005 Administrators Posted August 17, 2005 Could you not use either the .SelectedItems or .SelectedIndices properties to get this? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
flann Posted August 17, 2005 Author Posted August 17, 2005 tried both? here's what I have.. Dim oProcess As System.Diagnostics.Process Dim x As Integer x = ListView1.SelectedItems.IndexOf oProcess.Start(strFiles(x)) Quote Flann Mortgage Calculator | Debt Free Credit Card Debt | Filing Bankruptcy
VagabondSW Posted August 17, 2005 Posted August 17, 2005 How about this? Private Sub ListView1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick Dim index As Integer Dim item As ListViewItem item = ListView1.SelectedItem index = item.Index 'OR For Each item As ListViewItem in ListView1.SelectedItems index = item.Index Next End Sub Quote "Never ascribe to malice that which can adequately be explained by incompetence." -- Napolean Bonaparte
flann Posted August 17, 2005 Author Posted August 17, 2005 this worked. Dim x As Integer For Each x In ListView1.SelectedIndices Dim oProcess As System.Diagnostics.Process oProcess.Start(strFiles(x)) Next Quote Flann Mortgage Calculator | Debt Free Credit Card Debt | Filing Bankruptcy
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.