Jump to content
Sign in to follow this  

What controls scroll handle size?

Recommended Posts


I have a scrollable control that contains an image. When the image is twice a big as the scrollable area can display, I would like the scroll handle to be half the height of the scroll area. Instead, it's maybe 1/20th -- too small to easily grab. The childGUI is defined with this statement:

_GUIScrollBars_SetScrollInfoMax($hChildGUI, $SB_VERT, $Height-300)

where $height is the height if the image and 300 is the height of the scrollable area on the window.

So far, I haven't found any setting that affects the handle's height.

Thanks in advance for any help.


Edited by qwert

Share this post

Link to post
Share on other sites

#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>

Global $hGUI = GUICreate('Test', 200, 200)
_GUIScrollBars_Init($hGUI, 500, 500)

AdlibEnable('_Randomness', 1000)

Until GUIGetMsg() = -3

Func _Randomness()
    _GUIScrollBars_SetScrollInfoPage($hGUI, $SB_HORZ, Random(20, 100, 1))
    _GUIScrollBars_SetScrollInfoPage($hGUI, $SB_VERT, Random(20, 100, 1))

Share this post

Link to post
Share on other sites

Thanks for the nice example. I was able to add this line and get the result I wanted:

_GUIScrollBars_SetScrollInfoPage($hChildGUI, $SB_VERT, 400)

From MSDN:

nPage Specifies the page size. A scroll bar uses this value to determine the appropriate size of the proportional scroll box.

"determine the appropriate size" sounds like a calculation. Too bad they don't say what it is. I'll have to experiment.

Thanks again for your help.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this