Ho una CLV composta da pannelli aventi una Label e una CheckBox
Al click sulla CheckBox volgio cambiare colore alla label in base alla spunta o meno, e fin qui tutto ok.
Se però aggiungo un item già "spuntato", l'evento CheckedChange mi dà errore (credo del Sender)
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
			
			Al click sulla CheckBox volgio cambiare colore alla label in base alla spunta o meno, e fin qui tutto ok.
Se però aggiungo un item già "spuntato", l'evento CheckedChange mi dà errore (credo del Sender)
			
				B4X:
			
		
		
		Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout1")
    'Crea una lista
    For i = 0 To 10
        clvSoci.Add(CreaRigaCLVSoci("Nome-" & i,False), "")
    Next
        
End Sub
Sub CreaRigaCLVSoci(nome As String, checked As Boolean) As Panel
    Dim pnl As B4XView = xui.CreatePanel("")
    pnl.SetLayoutAnimated(0, 0, 0, clvSoci.AsView.Width, 50dip)
    pnl.LoadLayout("layPartecipante")
    lblNome.Text = nome
    ChkNome.Checked=checked
    Return pnl
End Sub
Sub chkNome_CheckedChange(Checked As Boolean)
    
    Dim index As Int = clvSoci.GetItemFromView(Sender) <===    'qui da errore di oggetto non inizializzato quando eseguo 'btnAggiungi'
    
    Dim pnl As B4XView = clvSoci.GetPanel(index)
    Dim lbl As B4XView = pnl.GetView(0)
    clvSoci.AsView.BringToFront
    
    If Checked Then   
        lbl.TextColor=Colors.RGB(70,134,208)
    Else
        lbl.TextColor=Colors.RGB(0,0,0)
    End If   
End Sub
Sub btnAggiungi_Click
    
    clvSoci.Add(CreaRigaCLVSoci("Nome Aggiunto",True), "")
    
End Sub 
				 
 
		 
 
		 
 
		 
 
		 
 
		