I have a ScrollBox and I populate it with lot's of TLables and TVirtualStringTrees... I create a long report with heading (TLabel) and data grid (TVirtualStringTree) and it works fine. By default I have 10+ reports and show the ones that have any data. So, sometimes I show all of them, sometimes just 1 or 2 (each has label/name of report and virtual tree for data).
So, they are all already in the scroll box, I just hide/show the ones I need.
The problem is that in very rare cases the first few reports have a couple of thousand lines/nodes, so the scroll box can quickly get to 50.000 in height. The problem is, that virtual trees don't go after 32767 point! Meaning all treeviews that should be located on positions 32767+ get stuck on that position, but all the labels get positioned to a proper pos in scroll box, 50.000, 100.000+.
I searched around and found that TScrollBox used to have a problem with not extending beyond 32767, due to some Windows limitation. Either this was true in earlier Delphi version, I use D2006, because TLabel has no problem being position beyond 32767 position mark.
So, is it a limitation of ScrollBox that affects TVirtualStringTree or is it TVirtualStringTree limitation? Any suggestions how to overcome it?
You can test with simple, TScrollBox and put TLabel and TVirtualStringTree inside. Then set:
Label1.Top := 35.000;
VirtualStringTree1 .Top := 35.020;
and it won't work, tree view will be shown higher than label.
As said, this happens in rare occasions, but it does, so I don't want to change the whole logic of how the scroll box works (I found some suggestions to trick the user with how the visible area of scroll box is presented to show the controls correctly as though they appear below 32767 mark, bu they are actually juts near the top - this is not what I want to do).