Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make scrollbars wider/bigger for delphi, (including the scrollbar's arrows)

For accessibility purposes, I need to make the scrollbars for all scrollable controls (lists, list views) wider and the scrollbar arrows bigger.

  1. How to get the scrollbars (handles) from a scrollable control (ex: TListView) ?

  2. How to make the scrollbar and the arrows wider/bigger ?

10x for any hints and code...

like image 370
user68682 Avatar asked Dec 31 '22 04:12

user68682


2 Answers

Accessibility is something that does not concern a single application, but the whole system. That's why there is no API defined to adjust things like border widths, scrollbar size and similar properties of the native controls only for your program. You can however adjust these settings globally in Windows, either by using the Accessibility Wizard, or by adjusting fonts, colours, border sizes and scrollbar sizes in the Display Properties applet.

For more information you should check out the Microsoft Accessibility page and follow the various links.

Edit: Changing the global settings (as the accepted answer suggests) for the benefit of your own program is rude in the extreme. Please keep in mind that this interferes with all other running programs. It is maybe excusable for a system with a touch screen, where controls need to be large to be usable at all - but on such a system the control sizes would probably already be set correctly.

like image 153
mghie Avatar answered Jan 13 '23 13:01

mghie


I'm not sure that you can - You have to change it (and restore back) for whole Windows.

http://www.greatis.com/delphicb/tips/lib/system-captionfont.html

Setting and reading property TNonClientMetrics.iScrollWidth


Edit: I know that this solution is rude, but in common cases is the best that you CAN do. If you have specialized TabletPC application then you usually use only that application at one time, not others. But - almost all Windows applications are not designed to work with so big scroolbars. So when you need to use OS dialogs and other applications then you have to switch it back.

There is no better solution than "while is my touchscreen application running set Window scroolbars big, then return it back". We have exactly this application in real world so I know what I'm talking about.

Of course you can write your own grid control (if you have so much time) or use some thirdparty controls (if you have money and time), but that was not question.

like image 22
DiGi Avatar answered Jan 13 '23 14:01

DiGi