
LISTVIEW HELP - SOLVE MY PUZZLE PLEASE
Quote:
>Dim lstX As ListItem
> Set lstX = lsvList.ListItems.Add(, "NEW LIST ITEM KEY", "NEW LIST ITEM
TEXT")
> lsvList.EditMode=tvwManual
> Set lsvList.SelectedItem = lsvList.ListItems(lstX.Index)
> lsvList.StartLabelEdit
Try it this way ...
< --- code begins here --->
Private Sub Form_Activate()
ListView1.SetFocus
ListView1.StartLabelEdit
End Sub
Private Sub Form_Load()
ListView1.LabelEdit = lvwManual
ListView1.ListItems.Add , "item1", "New Item Text"
ListView1.SelectedItem = "item1"
End Sub
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
Debug.Print ListView1.SelectedItem
End Sub
< --- code ends here --->
It seems you need an extra listview.setfocus to get the job done ...
And you must put the call in the form_Activate, because you can't call the
setfocus from the form_Load event.
hope this solves your problem ...
greetz
Christophe VG