Ranorex

Scrolling in List View

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexCore
View previous topic :: View next topic  
Author Message
Nik



Joined: 29 Sep 2006
Posts: 18

PostPosted: Wed Oct 25, 2006 1:37 am    Post subject: Scrolling in List View
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
Back to top
View user's profile Send private message
Nik



Joined: 29 Sep 2006
Posts: 18

PostPosted: Wed Oct 25, 2006 7:02 pm    Post subject: Re: Scrolling in List View
Please read tree view as list view. Typo mistake.

-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
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Wed Oct 25, 2006 10:56 pm    Post subject:
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.

Code: click into code to enlarge
for(int i=0; i< childCount; i++)
{
  if ( RxElementGetChild(&listElement, i, &listItem) == TRUE )
  {
    RxElementSelect(&listItem, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
    RxControlSendKeys(hListView,"{LEFT}");
    RxSleep(300);
  }
}

Jenö Herget
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Nik



Joined: 29 Sep 2006
Posts: 18

PostPosted: Fri Oct 27, 2006 6:45 am    Post subject:
It worked for me.
Thanks
Nikhil
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexCore All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum