Ask a Question

How can I use scroll bar methods

SOLVED
MulgraveTester
Frequent Contributor

How can I use scroll bar methods

I have a script that uses [PageDown] to move from the top of a SysListView32 to the bottom. Unfortunately the [PageDown] key causes unwanted behaviour so I want to use the vertical scroll bar instead.

 

The SysListView32 has a CWnd_SetScrollPos method but there is no help for this and the function description shown in the object spy simply says:

"Function CWnd_SetScrollPos(Param1 as Integer, Param2 as Integer, Param3 as Integer) as Integer"

with no indication what each of the parameters are for.

 

Can you provide help on this and other scroll bar methods?

 

How else can I move the list using the vertical scroll bar?

11 REPLIES 11
Marsha_R
Community Hero

See if this helps:

 

https://support.smartbear.com/viewarticle/71199/


Marsha_R
[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

The ListView32 does not have a .Window("TScrollBar") object, so none of the help seems relevant.

 

There are 300 items in my list object with 42 in view at any one time.

I've found that the vScroll.Pos property is read/write so I can set the position with

   myObj.vscroll.Pos = 41

 

This works for some values but I get an error for others

"Failed to set position 41 for the scroll bar. 42 was set instead."

 

There is nothing in the application that prevents me sliding the scrollbar to any position with the mouse, so now I am wondering why some values are Ok and some are not. How do I slide the scrollbar without creating errors?

41 probably fails if the object is not visible at that pont.

 

(You mention there are only 42 of 300 visible)

 

So I suspect it doesn't work if you try and point it to a non-visible item and it goes to the next available visible one.

Or do you mean 42 of the 300 are visible within the scrollable window?

 

Does the containing window not have any other scroll methods?

Hi Colin,

The list shows item 0 to 41. There are 300 items in total.

I should be able to select any index in the range 0 to 259 (300 - 41). Some values are fine but others generate the error.

 

I think the list is a CodeJock control, which is why the scroll bar is not standard. It has a VScroll element that has Max, Min and Pos properties. By setting the Pos I get this error. I get the error even without using any code because I can edit the Pos property in the object spy. (See attached)

Could you please provide screenshot with methods that are available for that control, and filter them by 'scroll'.

I've been using only ScrollIntoView method that takes object to scroll to as parameter, but it depends on how your contol is implemented.

Doing things properly => getting proper results => getting profit
djadhav
Regular Contributor

I tried this routine with the Windows taskmanager and it scrolls through the items.

'scroll down
Aliases.taskmgr.dlgWindowsTaskManager.MouseWheel -3
'delay(4000)
'scroll up
Aliases.taskmgr.dlgWindowsTaskManager.MouseWheel 8
MulgraveTester
Frequent Contributor

Hi Sereys,

Here is the screenshot. I don't have access to ScrollIntoView. My guess is that ScrollWindowEx would be the next best thing but I don't know how to use it. The parameters given by the object spy do not seem to tie up with what Micrtosoft have for this action. My guess is that if I try and use this action the application will crash because this action is not meant for external use.

 

Thanks,

 

MulgraveTester

MulgraveTester
Frequent Contributor

Hi djadhav,

I had not thought of using the mousewheel. This action works and is a possible solution to my problem (as long as I can work out how far I have to scroll).

 

many thanks,

 

MulgraveTester

cancel
Showing results for 
Search instead for 
Did you mean: