Forum Discussion
I need to expand the list and select one child object.
First I need to click on the "Routine" in the TreeView (attached Imange TreeView1.PNG) which will be expanded then I have to click on its child object "Field Notes" and then "national bridge Inventroy" and then select the last child item,(attached Image FullTreeView.PNG)
In this treeView Only the '+' sign in clickable
My goal is to select the last child item.
I tried using the Space click but its just refreshing the object.Trying for the coordinates.
OK. Sounds much the same as my second example.
So assign the tree container (the top level object - the tree itself) to a variable.
Do a FindChild on that using the content text to get the node you want.
Then get the Height property of the node. You don't need the width as you will always apply the click at the same point in from the left. Apply a click to the found node using half the height as the Y co-ordinate, and 4 (or whatever is applicable, I don't know the exact size and scaling here) as the X co-ordinate. This should apply the click on the "+" and expand the node.
Obviously, you'll probably need to put this in some sort of loop if you need to go several levels deep. I can see how it could be done, but I'm afraid I can't sit here at work and write an entire custom routine for you!
I have to do something very similar to this on a Tree View in my application as there are custom event triggers on it which are only triggered if the mouse click is applied in the correct place. So I do the same thing. Find the node, then use it's size and relative position to the parent control to work out where to apply the click.