I have a listview with process that are running. my goal is to pass the "path" of the process to a text box when someone clicks on a selection.
but my code isnt working correctly, this is what I have:
Private Sub lvwProcBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lvwProcBox.SelectedIndexChanged Dim pID As Integer = Int32.Parse(lvwProcBox.SelectedItems(0).SubItems(1).ToString) Dim proc As System.Diagnostics.Process = Process.GetProcessById(pID) procPath.Clear() Try Dim selectCount As Integer For selectCount = 0 To lvwProcBox.Items.Count() If lvwProcBox.SelectedItems(selectCount).Selected = True Then procPath.Text = (proc.MainModule.FileName.ToString()) End If Next Catch End Try End Sub
would be nice to fix i spent a week in google just trying ot find my solution.
and of course the text boxes path changes to a different path if a different selection is made