Setting width of scrollbars in an MFC program

Zoltán Hegedüs 101 Reputation points
2021-03-24T11:11:24.297+00:00

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.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,827 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,526 questions
0 comments No comments
{count} votes

Accepted answer
  1. Guido Franzke 2,196 Reputation points
    2021-03-24T11:37:50.31+00:00

    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.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Castorix31 81,636 Reputation points
    2021-03-24T11:33:07.123+00:00

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

    0 comments No comments

  2. Igor Tandetnik 1,106 Reputation points
    2021-03-24T13:25:38.293+00:00

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

    0 comments No comments