lundi 23 juillet 2018

VB.NET how to find a node and set checkbox=true

I am trying to use the find method to find a node in a treeview and then set the checkbox of that node to true.

    Dim node As TreeNode() = TreeView1.Nodes.Find(FindStr, True)

The code finds the node fine, but when I try something like

    TreeView1.Nodes(node).Checked=True

its not having any of it, node isnt returning an integer, I presume it is returning a collection of what its found which is fine, since the keys re unique it is only going to return the one node if it does find it but Im still not having any luck being able to check its box.

Ive been googling for an answer for well over an hour, trying varying keywords just in case but Im not getting any useful results back.




Aucun commentaire:

Enregistrer un commentaire