Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › KSVC Controls Bug when scrollbar width overridden
- This topic has 2 replies, 2 voices, and was last updated 2025-09-22 at 6:16 am by
Chris LeFebvre LeFebvre.
-
AuthorPosts
-
-
September 21, 2025 at 12:48 pm #4313
I recently upgraded to KSVC 8 on Delphi 12.3 and 8.0.1 on 13 and I’ve noticed some odd behavior under special circumstances. I have a VCL database application that has two versions, one for the desktop and one designed especially for a Windows 11 tablet that’s touch screen friendly. The problems I’ve noticed are on the version for the tablet, there are a number of things that had to be adjusted for use on a touch screen. The big thing is that to scroll comboboxes and listboxes using touch I had to override the operating system’s default scrollbar width so that any control with a scrollbar has a width wide enough for a person to use their finger to scroll the given control.
This is the code I’ve been using to adjust the width of the scroll bars, I know from the person who gave this to me that it affects scrollbar width system wide.
procedure TMainForm.SetScrollbarwidth; Var LTemp: TNonClientMetrics; begin ResetScrollBarsClick( Self ); FillChar(LTemp, sizeof(LTemp), 0); LTemp.cbSize := sizeof(LTemp); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(LTemp), @LTemp, 0); FOldScrollbarWidth := LTemp.iScrollWidth; { Save Scrollbar width } LTemp.iScrollWidth := 34; SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(LTemp), @LTemp, 0); end;To restore the system scrollbar width:
procedure TMainForm.RestoreScrollbarWidth; var LTemp: TNonClientMetrics; begin If FOldScrollbarWidth <= 0 then Exit; FillChar(LTemp, sizeof(LTemp), 0); LTemp.cbSize := sizeof(LTemp); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(LTemp), @LTemp, 0); LTemp.iScrollWidth := 17; SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(LTemp), @LTemp, 0); end;After this code changes the scrollbar width there are at least two problems that I’ve seen, the first is that in a TrzListBox the width of the scrollbar is set at the specified width but the handle width does not match the scrollbar width and appears at the original system width of the handle.
Second, a TrzCombobox has issues with it’s scrollbar when you click on the pulldown menu. As you attempt to scroll the pulldown list at various random times the Up and Down arrow buttons stop working and if you click on the track to try and scroll the thumb that way it also randomly doesn’t respond.
I’ve been able to test this in a small example program. Is there any way to overcome these issues in code or do I need to report this to Embarcadero Quality Central?
-
September 21, 2025 at 11:20 pm #4314
Hi Chris,
The TRzListBox and TRzComboBox are descendants of the TCustomListBox and TCustomComboBox, respectively. Neither version does anything specific with the scroll bars. I’d be curious if you try out the same technique with the TListBox and TComboBox, do you get the same behavior?Ray
-
September 22, 2025 at 6:16 am #4320
Hi Ray:
I did a quick test with TListbox and TCombobox and yes as far as I can tell the results are the same, the thumb in the TListbox is the original system width not the width set for the scrollbar and the TCombobox randomly sticks where clicking the up / down arrows does not scroll and clicking on the track also does not scroll the list.
-
-
AuthorPosts
- You must be logged in to reply to this topic.