Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / March 2006



Tip: Looking for answers? Try searching our database.

ScrollBar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ivar - 28 Mar 2006 08:02 GMT
Hi all.

With VB6 intrinsic ScrollBars. Is it posible using APIs to retrieve info on
the size and position of the scroll button. The position of the button
changes when the value changes, and the size of the button changes depending
on the differance between min and max. Once the value changes can the
position and size of the button be found in relation to the scrollbars
height and width?

Thanks

Ivar
Randy Birch - 28 Mar 2006 20:28 GMT
I thinks there's a scx/y_thumb-like message you can use with
SystemParametersInfo to retrieve the thumb size. Not that I really see the
need to know this info.

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
Ivar - 28 Mar 2006 22:18 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.