Recent

Author Topic: Scrollbar slider size  (Read 372 times)

Okoba

  • Sr. Member
  • ****
  • Posts: 363
Scrollbar slider size
« on: November 25, 2022, 01:29:35 am »
Hi,

I have TScrollBar, but changing the value of Max, Min, PageSize, SmallChange or LargeChange does not change the slider or thumb size.
How can I change it?
I am tasting this with Lazarus Trunk in Windows.

Okoba

  • Sr. Member
  • ****
  • Posts: 363
Re: Scrollbar slider size
« Reply #1 on: November 25, 2022, 01:45:51 am »
And is there a way I can get the slider or thumb size? For example if I add items to a memo or grid, the scroll slider decreases. Can I get this value from a TScrollBar and a control with scroll, like memo?

zeljko

  • Hero Member
  • *****
  • Posts: 1386
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Scrollbar slider size
« Reply #2 on: November 25, 2022, 07:22:31 am »
LCLIntf.GetScrollInfo
LCLIntf.SetScrollInfo

Okoba

  • Sr. Member
  • ****
  • Posts: 363
Re: Scrollbar slider size
« Reply #3 on: November 25, 2022, 07:50:31 am »
Thank you but it is not working.
1- It does not set the value
2- It loses the style of the control.

Code: Pascal  [Select][+][-]
  1.   with ScrollInfo do
  2.   begin
  3.     cbSize := SizeOf(ScrollInfo);
  4.     fMask := SIF_ALL;
  5.     nMin := 1;
  6.     nMax := 100;
  7.     nPage := 2;
  8.     nTrackPos := 0;
  9.   end;
  10.   SetScrollInfo(ScrollBar1.Handle, SB_Vert, ScrollInfo, True);  
  11.  

Please note that it is a TScrollBar not a control with ScrollBars.
Look at the screenshot for seeing that button has the Windows theme, but Scrollbar lost it when I called SetScrollInfo.


dsiders

  • Hero Member
  • *****
  • Posts: 761
Re: Scrollbar slider size
« Reply #4 on: November 25, 2022, 08:56:25 am »
Hi,

I have TScrollBar, but changing the value of Max, Min, PageSize, SmallChange or LargeChange does not change the slider or thumb size.
How can I change it?
I am tasting this with Lazarus Trunk in Windows.

I am responding to your original post... because I cannot reproduce the problem. I too am using the current main branch:
Lazarus 2.3.0 (rev main-2_3-2376-ge6f85953d8) FPC 3.2.2 x86_64-win64-win32/win64. Tested on Windows 8.1 and Windows 11. Using the Min , Max, and PageSize properties in TScrollBar. No Issues.

Screenshot and sample project attached.

Preview Lazarus 2.3.0 documentation at: https://dsiders.gitlab.io/lazdocsnext

Okoba

  • Sr. Member
  • ****
  • Posts: 363
Re: Scrollbar slider size
« Reply #5 on: November 27, 2022, 02:35:21 pm »
Thank you so much dsiders. Your demo helped me to find my confusion.

 

TinyPortal © 2005-2018