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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar width 1

Status
Not open for further replies.

florindaniel

Programmer
Dec 4, 2009
120
RO
Hello,

Do you have a solution for some wider scroll bars?

I need a combobox and a grid with wider vertical scroll bars.


Thank you
 
The simple answer is no.

The mildly better looking answer is, you can use ole control scrollbars, but the complexity is how to translate the ole control scrolling to grid or combobox scrolling 1:1, and in case of combo, when and where in which size to make the ole scrollbar visible.

Bye, Olaf.
 
You can change the width of scrollbars via Control Panel -> Personalization -> Window Color -> Scrollbars (in Win7) but it affects all applications.

For different versions of Windows

Here is a programmatic way

Code:
Declare integer SystemParametersInfo in win32api integer uiAction, integer uiParam, string@ pvParam, integer fWinIni      
#define SPI_GETNONCLIENTMETRICS 41
#define SPI_SETNONCLIENTMETRICS 42    
#define SPIF_SENDCHANGE  2
#define NCM_SIZE 10*4+5*60

* Get current settings    
ncm_current = Padr(BinToC(NCM_SIZE,"4RS"),NCM_SIZE,Chr(0))
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,NCM_SIZE, @ncm_current, 0)

ncm_changed = m.ncm_current
* set scrollbars to 30 pixels
ncm_changed = STUFF(m.ncm_changed,9,4,BINTOC(30,"4RS"))
*ncm_changed = STUFF(m.ncm_changed,9,4,BINTOC(17,"4RS")) && change back to 17
* set titlebar to 40 pixels
ncm_changed = STUFF(m.ncm_changed,21,4,BINTOC(40,"4RS"))
*ncm_changed = STUFF(m.ncm_changed,21,4,BINTOC(21,"4RS")) && change back to 21
*Apply new settings    
SystemParametersInfo(SPI_SETNONCLIENTMETRICS,NCM_SIZE, ncm_changed,SPIF_SENDCHANGE)

See
Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
I tried finding out where to set this in Windows 8 Personalization of the Display settings, but as it seems from your eightforums.com link it's now buried in the registry.

Yes, those metrics are system metrics, also see Sysmetric() for some of them, eg Sysmetric(5), Sysmetric(15). These also work on Win8.1, that hints on some API reading them generically on all OSes and it's a metric you can change with Windows Themes.

Maybe these metrics have always been in the registry, just the interface to change them was removed in Windows 8.

Bye, Olaf.
 
The usual answer to this type of question is that it is none of our business. The width of the scroll bars - like all other matters of personalisation - should be left to the user. If the user wants wide scroll bars, they will go to Control Panel and make the necessary adjustment. It's not our job to muscle in on that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Vilhelm,

Thank you for valuable info,
However, using that code for ScrollBars changes size for form's scroll bars
not for a combo-box used inside the form.
The funny part though is if using system config (Control Panel->Personalization...)
it resizes all the scroll bar, combobox included.

Thank you,
Daniel
 
Hi,
I return to my previous post: the scroll bars of the combobox DO resize, the difference
between programatic change and manual one is
- in the manual mode the combobox shows wider DropDown arrow while
- in programatic mode the DropDown arrow remains in it's initial state.
But the ScrollBars are OK, they do resize.

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top