Make sure that you have an item selected in your listview:
VB Code:
If lvResults.SelectedItems.Count > 0 Then If e.Button = MouseButtons.Right Then Dim lvItem As ListViewItem = lvResults.SelectedItems(0) If lvItem.SubItems(1).Text = "" Then Else Clipboard.SetDataObject(lvItem.SubItems(1).Text, True) UpdateStatus(lvItem.SubItems(1).Text & " copied to clipboard") End If End If end if
But also listen to apolizoi about adding Try Catch blocks to your code.




Reply With Quote