[Lazarus] How to query vertical scrollbar width?

Vincent Snijders vsnijders at vodafonevast.nl
Wed Aug 19 10:59:04 CEST 2009


Graeme Geldenhuys schreef:
> Hi,
> 
> I'm working on some GUI code in the tiOPF project that currently works 
> with VCL, LCL and fpGUI.
> 
> Is there a cross-platfrom, LCL way to query the width of the current 
> widgetset scrollbars? Defaults in Win2000 and WinXP seem to be 15px wide 
> for the vertical scrollbar, but I am sure that with custom themes, that 
> value might change. So we don't want to hard-code any values.
> 
> 
> ==================================
> You can detect if the scrollbars are showing using the Win32 API like this:
> 
> You can get the size of the scrollbars using Win32 API function
> GetSystemMetrics().
> 
>   GetSystemMetrics(SM_CYHSCROLL) // Height of horizontal scrollbar
>   GetSystemMetrics(SM_CXVSCROLL) // Width of vertical scrollbar
> ==================================

I would try:
http://lazarus-ccr.sourceforge.net/docs/lcl/lclintf/getsystemmetrics.html

Vincent




More information about the Lazarus mailing list