
Signature
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
Please reply to the newsgroups so all can participate.
: Hi all.
:
[quoted text clipped - 8 lines]
:
: Ivar
> Not that I really see the need to know this info.
I needed a scrollbar with a few more properties, methods and events than
those provided by the standard VB scrollbar. Couldn't find what I was
looking for on the net so I made my own user control.
Making a fixed size scroll button is easy, but doing all the maths for
calculating the size of the button so that it's the same size as a VB
scrollbar button. Works well most of the time, but sometimes the maths go
wrong.
The solution is easy :-). Put a hidden VB scrollbar on the user control.
Make it have all the same properties as the user control, then get the size
of the VB scroll button and use that info to draw the user control button.
The hard bit is finding the rect of the VB scrollbar button.
There seems to be no way to get this info! Unless someone knows different
Ivar
> : Hi all.
> :
[quoted text clipped - 10 lines]
> :
> : Ivar
Randy Birch - 28 Mar 2006 22:41 GMT
'The width of the thumb box in a horizontal scroll bar, in pixels.
const SM_CXHTHUMB as long = 10
'The height of the thumb box in a vertical scroll bar, in pixels.
const SM_CYVTHUMB as long = 9
Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
hscrollThumbWidth = GetSystemMetrics(SM_CXHTHUMB)
vscrollThumbHeight = GetSystemMetrics(SM_CYVTHUMB)

Signature
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
Please reply to the newsgroups so all can participate.
: > Not that I really see the need to know this info.
: I needed a scrollbar with a few more properties, methods and events than
[quoted text clipped - 26 lines]
: > :
: > : Ivar
Ivar - 28 Mar 2006 23:16 GMT
Thanks for the input Randy, but I think the point is being missed. It's the
size of the moving button on a scrollbar that I'm looking for. On a vertical
scrollbar the size of the button is influenced by the large change property,
the height of the scrollbar and the Min and max Max values.
So much maths that the VB scrollbar does so well.
I've looked in to GetScrollInfo but does not return the info I'm after.
Is there somewhere else I can look?
Thanks
Ivar
> : > Not that I really see the need to know this info.
> : I needed a scrollbar with a few more properties, methods and events than
[quoted text clipped - 34 lines]
> : > :
> : > : Ivar