Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I find the Scrollbar size? 1

Status
Not open for further replies.

Griffyn

Programmer
Jul 11, 2002
1,077
AU
Hi all,

I get the feeling this one's so obvious that it's right in front of me, but I can't see it.

I want to find out the width of a vertical scrollbar. That would be defined in the Windows' Display properties, where you go (Control Panel, Display, Appearance, click the scrollbar in the window, and see what it's size is.

I need this because I'm trying to automatically size a form that has a TDBGrid on it, and the DBGrid.Align is set to alClient. So, I've been adding up the column widths of the DBGrid, but the vertical Scrollbar width is putting it out. Now - I could hardcode it, but then anyone who's Windows Theme has a different size scrollbar will have it go all screwy on them.

Can anyone help?

Thanks.
 
Mmm... GetSystemMetrics with SM_CXHSCROLL, SM_CYHSCROLL?

buho (A).

 
Actually used SM_CXVSCROLL for the width of the vertical scrollbar. Thanks buho.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top