How to remove a selected item in treeview c#

Asked

Viewed 119 times

0

I am developing a new application but I have a final problem to solve and I have tried googlear and nothing I can not find any example.

in fact I want to delete the item in treeview that was selected

I tried so but give me a mistake

Error 1 'System.Windows.Forms.Treeview' does not contain a Definition for 'Items' and no Extension method 'Items' Accepting a first argument of type 'System.Windows.Forms.Treeview' could be found (are you Missing a using Directive or an Assembly Reference?)

I tried so :

listMessages.Items.Remove(listMessages.SelectedItem);

1 answer

1


  • Why do you have to wear Nodes instead of Items?

  • Because Items doesn’t exist, @Francisco

Browser other questions tagged

You are not signed in. Login or sign up in order to post.