I've implement a log viewer using a TListBox
in virtual mode.
It works fine (for all the code I wrote), displays the content as expected (I even added an horizontal scrollbar easily), but I guess I've reached the some kind of limit of the vertical scrollbar.
That is, when I scroll the vertical bar from the top to the bottom, it will not scroll the content to the end of the list, but only to some limit.
Do you know any possibility to get rid of this limit? I tried with SetScrollInfo
, but it didn't work since the limit sounds to be not in the scrollbar, but in the TListBox
itself.
I know the solution of creating a dedicated TCustomControl
: in this case, the SetScrollInfo
will work as expected. But does anyone know about a solution/trick to still use TListBox
?
Edit: to make it clear - I don't ask for a (third-party) component solution, but to know if there is some low-level GDI message to send to the standard TListBox
to override this limit. If there is none, I'll go to the dedicated TCustomControl
solution.
Here is the code using TSCROLLINFO:
procedure ScrollVertHuge(Handle: HWND; count: integer);
var Scroll: TSCROLLINFO;
begin
Scroll.cbSize:= sizeof(Scroll);
Scroll.fMask := SIF_DISABLENOSCROLL or SIF_RANGE;
Scroll.nMin := 0;
Scroll.nMax := count;
SetScrollInfo(Handle,SB_VERT,Scroll,false);
end;
To precise the issue: Adding and drawing both work, of course (my tool works as exepected), but what does not work is the vertical scrollbar dragging. I renamed the title of the question, and got rid of the deprecated MSDN articles, which are confusing.