private Sub sbCargar
Dim Indice As Int
CLV.Clear
For Indice=1 To 100
Dim Pn As B4XView=xui.CreatePanel("")
Pn.SetLayoutAnimated(0,0,0,Root.Width,60dip)
Pn.LoadLayout("lyLinea") ' Cargamos el diseño de cada registro,
Pn.GetView(0).Text=Indice ' Con Pn.GetView(0) obtenemos lblNumero
Pn.GetView(1).Text="Linea número " & Indice ' Con Pn.GetView(1) obtenemos lblTitulo
Dim B As Button=Pn.GetView(2)
B.Tag=Indice
' podemos hacer un diseño tipo cebra
If Indice Mod 2 =0 Then
Pn.Color=xui.Color_White
End If
CLV.Add(Pn,Indice)
Next
End Sub
Private Sub CLV_ItemClick (Index As Int, Value As Object)
Dim Indice As Int
Indice=Value
xui.MsgboxAsync("Ha pulsado en el registro " & Indice,"Ejemplo CLV")
End Sub
Private Sub btnEdit_Click
Dim B As Button
Dim Indice As Int
B=Sender
Indice=B.Tag
xui.MsgboxAsync("Ha pulsado en botón EDITAR el registro " & Indice,"Ejemplo CLV")
End Sub