To show what I mean an example below.
Problem is: Sometimes you can use a parameter to assign it to the Value property of an object (e.g. of a TreeView Node ), sometimes you can't.
When it does not work you get an error message like "cannot convert [...].String to System.Windows.Forms.TreeView"
Funny thing is: In most cases it works directly at the beginning of a sub. It never (?) works further down in the body of a sub.
Following example sub ist not working (assume TempNode is a TreeView node which has been initialized):
[I have tried several variants]
' parameter ile is a file opened with FileOpen for writing
' node is a TreeView node object
Sub RecursiveWrite (file, node)
' First use of node sometimes works
TempNode.Value = node ' Remark: or node.value, try both
FileWrite(file, TempNode.text)
nodeCount = TempNode.Count - 1
for i = 0 to nodeCount
RecursiveWrite(file, TempNode.GetNode(i))
' or:
' TempNode.Value = TempNode.GetNode(i)
' RecursiveWrite(file, TempNode.Value)
' Reset TempNode, never works
TempNode.Value = node ' or node.value, does not matter :-(
node
End Sub
Problem is: Sometimes you can use a parameter to assign it to the Value property of an object (e.g. of a TreeView Node ), sometimes you can't.
When it does not work you get an error message like "cannot convert [...].String to System.Windows.Forms.TreeView"
Funny thing is: In most cases it works directly at the beginning of a sub. It never (?) works further down in the body of a sub.
Following example sub ist not working (assume TempNode is a TreeView node which has been initialized):
[I have tried several variants]
' parameter ile is a file opened with FileOpen for writing
' node is a TreeView node object
Sub RecursiveWrite (file, node)
' First use of node sometimes works
TempNode.Value = node ' Remark: or node.value, try both
FileWrite(file, TempNode.text)
nodeCount = TempNode.Count - 1
for i = 0 to nodeCount
RecursiveWrite(file, TempNode.GetNode(i))
' or:
' TempNode.Value = TempNode.GetNode(i)
' RecursiveWrite(file, TempNode.Value)
' Reset TempNode, never works
TempNode.Value = node ' or node.value, does not matter :-(
node
End Sub