Hi,
I have a List view which has around 50 item. I have to click eack item which in turn displays more information about the item.
I am using the element approach to click the items in the list view. The problem is that list view does not display all the item. It displays around 10 items and then you have to use scroll bar to see the other items.
How should I implement this? When I use the element approach I can highlight the item but I am not able to click on the item down in the list view.
Also, tree view does not scroll to the highlighhted item by itself.
Please suggest. I am using VC6.0 on Win XP.
-Nikhil
Scrolling in List View
Re: Scrolling in List View
Please read tree view as list view. Typo mistake.
-Nikhil
-Nikhil
Nik wrote:Hi,
I have a List view which has around 50 item. I have to click eack item which in turn displays more information about the item.
I am using the element approach to click the items in the list view. The problem is that list view does not display all the item. It displays around 10 items and then you have to use scroll bar to see the other items.
How should I implement this? When I use the element approach I can highlight the item but I am not able to click on the item down in the list view.
Also, tree view does not scroll to the highlighhted item by itself.
Please suggest. I am using VC6.0 on Win XP.
-Nikhil
You are right, SELFLAG_TAKESELECTION doesn't scroll the item into view.
It works with ListBox and TreeView but it does not work with a ListView.
It seems to be a Microsoft bug, we will try to find a workaround for the next version.
But you can easily solve the problem with a little trick, send a LEFT keypress event after the item selection. This will scroll the item into view.
Jenö Herget
Ranorex Team
It works with ListBox and TreeView but it does not work with a ListView.
It seems to be a Microsoft bug, we will try to find a workaround for the next version.
But you can easily solve the problem with a little trick, send a LEFT keypress event after the item selection. This will scroll the item into view.
Code: Select all
for(int i=0; i< childCount; i++)
{
if ( RxElementGetChild(&listElement, i, &listItem) == TRUE )
{
RxElementSelect(&listItem, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
RxControlSendKeys(hListView,"{LEFT}");
RxSleep(300);
}
}
Ranorex Team