Jump to content
Xtreme .Net Talk

Remove a line from a ListView


Recommended Posts

Guest kanenas
Posted

Hi!

 

I have a listview and I want to make a button to remove any unwanted

entries. I tried

 

If Not lst1.SelectedItems Is Nothing Then

lst1.Items.Remove(lst1.SelectedItems(0))

End If

 

But I got an error in the second line

Any ideas?

Guest kanenas
Posted
I forgot to tell that this only happens when I haven't select any items
Guest kanenas
Posted
I would appreciate it if you were more specific because I'm new and quite confused. I don't know how this Try...Catch works!
Guest kanenas
Posted

Thanx for the help! It worked but

Msgbox(ex1.Description)

was unnecessary. At least it worked without it!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...