Hi
I have a tree view with checkboxes in it. For each parent node I have a combo box associated to it. And below each parent node I have child node that represent what choice we have in the combo box associated to the parent node.
Now when I click on a node child I put the node that the user just click on to the selectednode.
so I do this:
When I click on the Text of the Child node it's ok, but when I want to click on the checkbox beside it, it doesn't check the checkbox.
I found where is my problem but I don't understand why it does this.
So this is the code that I have in the TreeView1_AfterSelect event. I put the line where it cause this problem with *** before.
Thanks in advance
I have a tree view with checkboxes in it. For each parent node I have a combo box associated to it. And below each parent node I have child node that represent what choice we have in the combo box associated to the parent node.
Now when I click on a node child I put the node that the user just click on to the selectednode.
so I do this:
Code:
Private Sub TreeView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeView1.MouseDown
TreeView1.SelectedNode = TreeView1.GetNodeAt(e.X, e.Y)
End Sub
When I click on the Text of the Child node it's ok, but when I want to click on the checkbox beside it, it doesn't check the checkbox.
I found where is my problem but I don't understand why it does this.
So this is the code that I have in the TreeView1_AfterSelect event. I put the line where it cause this problem with *** before.
Code:
For Each TP In TabControl1.TabPages
For Each c In TabControl1.TabPages(idx).Controls
If TypeOf c Is ComboBox Then
If c.valuemember = NodeParentId Then
***c.Text = NodeText
found = 1
Exit Sub
End If
End If
Next
idx = idx + 1
Next
Thanks in advance