Una consulta sobre Listview.

19/07/2003 - 22:54 por aceror | Informe spam
Intento borrar pero no me sale

For i = ListView1.ListItems.Count To 1 Step -1
' si está seleccionado
If ListView1.ListItems(i).Selected Then

With ListView1.ListItems.Remove

Set tLi = ListView1.ListItems.Remove(i)
tLi.SubItems(1) = .Fields("Nombre") & ""
tLi.SubItems(2) = .Fields("NIFCIF") & ""
tLi.SubItems(3) = .Fields("Direccion") & ""
tLi.SubItems(4) = .Fields("Movil") & ""

End With

' lo borramos
'ListView1.ListItems.Remove i
End If
Next
End Sub
 

Leer las respuestas

#1 Eduardo A. Morcillo [MS MVP]
21/07/2003 - 18:45 | Informe spam
With ListView1.ListItems.Remove



Remove no es funcion ni propiedad, por lo tanto no devuelve ningun valor que
puedas usar con With.

Set tLi = ListView1.ListItems.Remove(i)



Lo mismo aqui.

'ListView1.ListItems.Remove i



Con esto eliminas el item que creo es lo quieres hacer. ¿Por que lo tienes
puesto como comentario?

Eduardo A. Morcillo [MS MVP - VB]
http://www.mvps.org/emorcillo

Preguntas similares