How do I lock and unlock ListView such that I can control when the user can edit the ListView?
Printable View
How do I lock and unlock ListView such that I can control when the user can edit the ListView?
Just disable it when you don't want them to have control.
ListView1.Enabled = False 'disable it
ListView1.Enabled = True 'enable it
the .enable had to be true, all the time, as I want the user to be able to sort the listview by column_header anytime (except when editing).
if .enable = false, then user could never sort by the column_header but they cannot edit the data.
if .enable = true, then user could sort by the column_header but they can edit the data too.
no other way??
Probably the simplest way is to intercept the keystrokes in the keypress and/or keyup events of the list control and set keyascii to zero.