Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: E N T E R en Octubre 25, 2012, 12:01:19 pm
-
Tengo este formulario con un ListView, quiero que al insertar el nuevo contenido siempre quede primero.
(http://www.mediafire.com/conv/3079ade8efe38d9aed26f5e8d92a73c9e3cc91ee0319843853008a75b56705f94g.jpg) (http://www.mediafire.com/view/?1h1y9cgl155rwvl)
Este es mi codigo que inserta en el ListView.
Private Sub Command1_Click()
Set Lv = ListView1.ListItems.Add(, , txtBuscar.Text)
With Lv
.SubItems(1) = Format(Time, "hh:mm:ss")
.SubItems(2) = lblEstado.Caption
End With
End Sub
Lo que no se puede hacer es ordenar, por que nunca se va insertar en un orden.
-
usa el indice, por ejemplo:
ListView1.ListItems.Add 1, , "Item1"
ListView1.ListItems.Add 1, , "Item2"
al final Item2 va a pisar el Item1 y queda en primera posicion..
saludos.
-
De lujo Seba, ni se me ocurro esa idea, muchas gracias
Private Sub Command1_Click()
Set Lv = ListView1.ListItems.Add(1, , txtBuscar.Text)
With Lv
.SubItems(1) = Format(Time, "hh:mm:ss")
.SubItems(2) = lblEstado.Caption
End With
End Sub
Saludos.