Hi,
I'm working on some GUI code in the tiOPF project that currently works with VCL, LCL and fpGUI.
We are resizing the last column of a StringGrid so that we leave space for the vertical scrollbar - if it appears. Below is the Win32 API calls to query the scrollbar width for VCL.
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:
if (GetWindowLong(StringGrid1.Handle, GWL_STYLE) and WS_VSCROLL) 0 then
// Vertical scrollbar showing
if (GetWindowLong(StringGrid1.Handle, GWL_STYLE) and WS_HSCROLL) 0then
// Horizontal scrollbar showingYou 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 ==================================
Regards,
- Graeme -
