question

ZoltnHegeds-7054 avatar image
0 Votes"
ZoltnHegeds-7054 asked IgorTandetnik-1300 answered

Setting width of scrollbars in an MFC program

My English is not perfect, sorry.

I am using Visual C++ 2019 16.9.2 Community, MFC, 64 bit Windows 10 Home 2004.
The scrollbars are too broad, so I want to narrow them.
But among settings of Windows, I did not find how can I narrow them.
Can I set this in Windows, for all the programs?
If yes, where?
If do not, (and naturally, also if yes), how can I set in my MFC program? Naturally, this applies to only my program, and I must set the width at the begin of the program: all times when my program runs.
Thank you.

c++windows-forms
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GuidoFranzke avatar image
0 Votes"
GuidoFranzke answered

Hello,
this is not possible in MFC. The width of the window scrollbar is a Windows setting.
As far as I know you can set a Windows Theme which can change the width. But this is a user defined Windows setting.
Nevertheless, maybe you can try to set the width in the Windows registry - although I would never change the global Windows registry settings. Have a look at this: 24c1df8e-8c76-4653-8421-d5274608d6dc
Regards, Guido

By the way: only use the tag c++ for VC++ and MFC, windows-forms is not VC++ MFC.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered

Globally, with SPI_SETNONCLIENTMETRICS (NONCLIENTMETRICSW structure)
Inside an app, Google gives : ResizeScrollbar - How to change width of built-in scroll bars
(not tested)



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IgorTandetnik-1300 avatar image
0 Votes"
IgorTandetnik-1300 answered

Enabling Flat scroll bars might work. The width is customizable via FlatSB_SetScrollProp

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.