Click to See Complete Forum and Search --> : ListView - selecting first item in list causes rename


J Surman
September 7th, 2001, 04:06 AM
I have an application with several Listview controls on it, in report view containing a few columns of data.

The application requires selecting some items in the ListView and adding them to another Listview.

My problem is that when the first item in the ListView is selected (only for the first item) It tries to let you rename the item, rather than merely selecting it.

Does anyone know if there is a way to stop this from happening?????

Andrew R.
September 7th, 2001, 09:47 AM
In design mode: right click on your ListView -> Properties -> General tab -> LabelEdit field should be set to Manual.

J Surman
September 7th, 2001, 09:53 AM
Thanks - it worked perfectly. Brilliant!!!

michi
September 7th, 2001, 10:20 AM
If you do it from code:
====
Private Sub ListView_BeforeLabelEdit(Cancel As Integer)
Cancel = True
End Sub
====

Regards,

Michi

wayneh
September 11th, 2001, 08:19 AM
In design mode, right-click on the ListView, select Properties...
Change the LabelEdit property from 0-lvwAutomatic to 1-lvwManual.
Note, you may also want to click the checkbox to the right to set FullRowSelect.