How can use treenode's checkbox to control other controls whether are visible or not?
-
Hi,Friends! I used a treeview with checkbox in my form, now I want that after I checked a node, a groupbox was visible, after I made the treenode unchecked, the groupbox was hidden.It is easy when I use checkbox ,but I don't know how to do this with treenode. I used AfterCheck event like this:
Private Sub treeMingPai_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles treeMingPai.AfterCheck
If e.Node.Text = "English" Then
e.Node.ForeColor = Color.RoyalBlue
grpYWMP.Visible = True
End If
End SubIt could make hidden groupbox visible when I had checked the treenode, but what should I do to make it hidden after I made it unchecked again? PLX help me and give me some suggestions!Thans a lot!
-
Hi,Friends! I used a treeview with checkbox in my form, now I want that after I checked a node, a groupbox was visible, after I made the treenode unchecked, the groupbox was hidden.It is easy when I use checkbox ,but I don't know how to do this with treenode. I used AfterCheck event like this:
Private Sub treeMingPai_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles treeMingPai.AfterCheck
If e.Node.Text = "English" Then
e.Node.ForeColor = Color.RoyalBlue
grpYWMP.Visible = True
End If
End SubIt could make hidden groupbox visible when I had checked the treenode, but what should I do to make it hidden after I made it unchecked again? PLX help me and give me some suggestions!Thans a lot!
-
The
AfterCheck
event is raised by both checking and unchecking actions. So base your actions one.Node.Checked
. CheersI don't like my signature at all