Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire
200 internautes nous ont dit merci ce mois-ci
Private Sub TreeView1_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterCheck Dim counter As Integer 'cocher parent If e.Node.Parent Is Nothing Then For Each oChild As TreeNode In e.Node.Nodes If oChild.Checked = False Then oChild.Checked = True End If Next counter = 0 Else If e.Node.Parent.Checked = False Then For Each oChild As TreeNode In e.Node.Parent.Nodes If oChild.Checked = True Then counter = counter + 1 If counter = e.Node.Parent.Nodes.Count Then e.Node.Parent.NodeFont = New Font("arial", 14, FontStyle.Bold, GraphicsUnit.Pixel) e.Node.Parent.ForeColor = Color.DarkSlateBlue End If End If Next End If End If End Sub End Class