L
Lynn
Hi,
I am trying to display the processes running on my system to a listbox. but
i got 'DisplayMember' is not a member of 'System.Windows.Forms.ListView'.
during debug.
any clues? below is the code
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
Dim prc As Process
' Remove existing items from the control.
ListView1.Items.Clear()
' Fill the control. Indicate which member of
' the items added to the list box should be
' displayed.
ListView1.DisplayMember = "ProcessName"
For Each prc In Process.GetProcesses()
ListView1.Items.Add(prc)
Next
ListView1.Sorted = True
Catch exp As Exception
MessageBox.Show(exp.Message, Me.Text)
End Try
End Sub
I am trying to display the processes running on my system to a listbox. but
i got 'DisplayMember' is not a member of 'System.Windows.Forms.ListView'.
during debug.
any clues? below is the code
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
Dim prc As Process
' Remove existing items from the control.
ListView1.Items.Clear()
' Fill the control. Indicate which member of
' the items added to the list box should be
' displayed.
ListView1.DisplayMember = "ProcessName"
For Each prc In Process.GetProcesses()
ListView1.Items.Add(prc)
Next
ListView1.Sorted = True
Catch exp As Exception
MessageBox.Show(exp.Message, Me.Text)
End Try
End Sub