Ask a Question

Test Complete: How to get the X/Y coordinates of an item in a TreeView control

SOLVED
jpytlik
Visitor

Test Complete: How to get the X/Y coordinates of an item in a TreeView control

I am using TestComplete 14.74 

 

I am trying to test a Drag/Drop feature in a TreeView control (implemented in C++/MFC).  I can get the position of the TreeView itself but, cannot for the life of me, figure out how to get the X,Y of the tree item that is currently selected.  

The Tree is like this and I would want to drag Level 1.1.1 to Level 2.1.1

Top Node

   | Level 1

        | Level 1.1

             | Level 1.1.1

        | Level 2.1

             | Level 2.1.1

 

The TreeView control is mapped and aliased

 

myApp = Aliases.MyApp
sysTree = myApp.MainFrame.ConfigurationManager.SystemViews.TreeView

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Test Complete: How to get the X/Y coordinates of an item in a TreeView control

Hi,

 

You need to get required object (e.g. 'Level 1.1.1') and then use its properties to get X, Y coordinates that you need (usually - .Top, .Left, .Height and .Width ones).

Check if https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/win32/tree-v... help article helps.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

1 REPLY 1
AlexKaras
Community Hero

Re: Test Complete: How to get the X/Y coordinates of an item in a TreeView control

Hi,

 

You need to get required object (e.g. 'Level 1.1.1') and then use its properties to get X, Y coordinates that you need (usually - .Top, .Left, .Height and .Width ones).

Check if https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/win32/tree-v... help article helps.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: