I want to select a file in tree view. The file is in embedded folder.
I tried using RxTreeViewSelectPath but this is not working.
Can you suggest some way of implementing this.
For e.g. I want to navigate to C:\Folder1\Folder2\ABC.txt.
I am using VC6.0 on WinXP.
-Nikhil
Navigation in Tree View
We cannot reproduce the bug with the windows explorer.
Do you use forward slashes "/" between the folder names?
But you can easily implement the functionality with elements:
Jenö Herget
Ranorex Team
Do you use forward slashes "/" between the folder names?
Code: Select all
RxTreeViewSelectPath(hTreeView, "Work (D:)/Ranorex/Samples/RanorexCppSample2");
...
Code: Select all
// Selecting the path "Work (D:)\Ranorex\Bin"
ElementStruct element;
if ( RxControlGetElement(hTreeView, &element) == TRUE)
{
ElementStruct treeItem1;
if ( RxElementFindChild(&element, ROLE_SYSTEM_OUTLINEITEM, "Work (D:)", NULL, &treeItem1)==TRUE)
{
RxElementSelect(&treeItem1, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
ElementStruct treeItem2;
if( RxElementFindChild(&treeItem1, ROLE_SYSTEM_OUTLINEITEM, "Ranorex", NULL, &treeItem2)==TRUE)
{
RxElementSelect(&treeItem2, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
ElementStruct treeItem3;
if( RxElementFindChild(&treeItem2, ROLE_SYSTEM_OUTLINEITEM, "Bin", NULL, &treeItem3)==TRUE)
RxElementSelect(&treeItem3, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
}
}
}
Ranorex Team