Forum > General
Scrollbar slider size
Okoba:
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:
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:
LCLIntf.GetScrollInfo
LCLIntf.SetScrollInfo
Okoba:
Thank you but it is not working.
1- It does not set the value
2- It loses the style of the control.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- with ScrollInfo do begin cbSize := SizeOf(ScrollInfo); fMask := SIF_ALL; nMin := 1; nMax := 100; nPage := 2; nTrackPos := 0; end; SetScrollInfo(ScrollBar1.Handle, SB_Vert, ScrollInfo, True);
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:
--- Quote from: Okoba 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.
--- End quote ---
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.
Navigation
[0] Message Index
[#] Next page