J
James Hahn
I am using the text in a treeview to access some internal data that is
contained in the first child of a parent. It is accessed in the AfterSelect
event using ByVal e As System.Windows.Forms.TreeViewEventArgs. The node
contains valid data, as indicated by the text displayed in the control, and
the fact that when I select the relevant (child) node the following code
works and I can also see a correct value in the debugger if I pause at this
line:
Nodelist.Add(fht(Mid(e.Node.Text, 5)))
But I cannot access the same node if I click on the parent and attempt to
access the first child node:
Nodelist.Add(fht(Mid(e.Node.Nodes(0).Text, 5)))
The above line returns a meaningless value. I can't look at the text for the
node in the debugger because it shows:
e.node.nodes
Count: 11
IsReadOnly: No
Item: In order to evaluate an indexed property the property must be
qualified and the arguments must be explicitly supplied by the user.
Why is it referring to item and not text, and why is it telling me I have
not qualified the property properly? It's as if an element of the nodes
collection cannot have a text property. Is this some result of accessing the
control through the TreeViewEventArg?
contained in the first child of a parent. It is accessed in the AfterSelect
event using ByVal e As System.Windows.Forms.TreeViewEventArgs. The node
contains valid data, as indicated by the text displayed in the control, and
the fact that when I select the relevant (child) node the following code
works and I can also see a correct value in the debugger if I pause at this
line:
Nodelist.Add(fht(Mid(e.Node.Text, 5)))
But I cannot access the same node if I click on the parent and attempt to
access the first child node:
Nodelist.Add(fht(Mid(e.Node.Nodes(0).Text, 5)))
The above line returns a meaningless value. I can't look at the text for the
node in the debugger because it shows:
e.node.nodes
Count: 11
IsReadOnly: No
Item: In order to evaluate an indexed property the property must be
qualified and the arguments must be explicitly supplied by the user.
Why is it referring to item and not text, and why is it telling me I have
not qualified the property properly? It's as if an element of the nodes
collection cannot have a text property. Is this some result of accessing the
control through the TreeViewEventArg?