3
votes

In my Delphi 10.2 VCL application there seems to be a problem with the default modern Windows10 VCL style. On builtin Delphi component, like the TFontDialog, the user cannot use vertical scrolling in dropdown components. The arrows can't be clicked and the scrollbar can't be dragged, only scrolling up and down with the mousewheel works. If I'm using older VCL styles (for example the old XP style Windows) this is not an issue, the user can use all controls and everything works as expected.

TFontDialog Example

TFontDialog.Create(Form1);
TFontDialog.Execute;

faulty scrollbars in a fontdialog

Vertical scrolling in the color dropdown component is not usable (highlighted in red), only mouse scrolling is possible, the user cannot click the arrows or drag the scrollbar.

TOpenPictureDialog Example

TOpenPictureDialog.Create(Form1);
TOpenPictureDialog.Execute;

faulty scrollbars in a picturedialog

Vertical scrolling in the dropdown component is not usable (highlighted in red).

BrowseForFolder Example

TDirectoryListBox.directory := BrowseForFolder('Choose a folder', '', false);

faulty scrollbars in browseforfolder

Vertical scrolling in the color dropdown component is not usable (highlighted in red), only mouse scrolling is possible, the user cannot click the arrows or drag the scrollbar.

I tried the suggestion from @RRUZ in response to a different problem (Delphi 10 Seattle - Vista Dialogs bug with VCL Styles) to add the VCL Styles Utils project files, but I couldn't detect any changes with the additional files in my uses section.

edit: Delphi 10.2 Version 25.0.29899.2631

1
Can't reproduce in 10.2.2. A great workaround would be not to use VCL styles, though.Andreas Rejbrand
Unfortunately the application allows users to switch styles, but I'll try to disable the VCL Styles of the components in questionpskiebe

1 Answers

2
votes

This doesn't fix the problem, but is acceptable to me as a workaround. @AndreasRejbrand suggested in his comment, that I do not use VCL Styles. I can't do that, but I got the idea from him to disable the styling of the components in question.

@RRUZ described in How to disable vcl styles on external dll forms in delphi how to null TStyleManager.SystemHooks and @AriochThe described in Delphi. How to disable Vcl Themes for TFileOpenDialog and TOpenDialog how to null TStyleManager.SystemHooks for a specific component. Which led me to the following workaround in TForm1.FormCreate:

with TStyleManager do
    SystemHooks := SystemHooks - [shDialogs];

TFontDialog doesn't look much different (except for the down arrow), but the vertical scrollbar is fully functional now.

working vertical scrollbar