i would like to know how can i change the name of a ListView item in the traditional select>F2>edit>enter manner. How can i open that little editable textbox just over the item?
Set the LabelEdit property to true. Add a KeyDown event handler to recognize the F2 keystroke. Like this:
private void listView1_KeyDown(object sender, KeyEventArgs e) {
if (e.KeyData == Keys.F2 && listView1.SelectedItems.Count > 0) {
listView1.SelectedItems[0].BeginEdit();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With