If I have a ListView embedded in a WinForm, is there any way I can simply click in the ListView and start typing in new items when the form is running?
A:
In visual studio when you click on the listview a small triangle in the top right appears. When you click on it you can edit columns, etc.
Kyra
2010-06-22 20:34:54
Sorry, I meant while my program is running (I made an edit to my OP)
Soo
2010-06-22 20:37:57
+1
A:
At runtime, no. The only edit option it has is the LabelEdit property. Set it to true to allow the user to edit the ListViewItem.Text property of existing items.
Hans Passant
2010-06-22 20:36:42
Is it possible while running the form to select items in the ListView and delete them?
Soo
2010-06-22 20:38:41
Sure, just implement the KeyDown event handler and delete the selected item if you see Keys.Delete. Might want to implement a ContextMenuStrip as well so it will work with a mouse. Being able to customize the list view in your code that way is the Power of Windows Forms.
Hans Passant
2010-06-22 21:29:45