We are experiencing what seems to be a strange bug in Firemonkey's ScrollBox component (since TGrid
inherits from TScrollBox
it also affects all grids). On some ouf our development machines, everything works fine, while on others the bug occurs. We failed to detect any pattern between the systems (we checked OS, graphics hardware, DirectX version).
Reproduction:
TScrollBox
on the form.If the bug occurs, the button is not visible.
When using a grid, this leads to lines 1-19047 being displayed correctly and all lines from 19047 and above not displayed.
Has anybody any idea what could be causing this? Or any idea how we can identify the problem in more detail?
After having all sorts of problems with scrolling, I have come to the conclusion that there is an initialisation problem with scrolling components in firemonkey, which manifest in dodgy scrolling behaviour. Sometimes it will work and sometimes it will not...
After having thought that I fixed the problem several times, only to watch the problem reappear on a subsequent compile (or a different OS), I have had much success in calling the component's UpdateStyle method after adding all of the child components. I.e. the problem has not resurfaced since adding the call...
E.g. The following pseudo code populates a scroll component then calls UpdateStyle which seems to force the component to 'fix' invalid settings for various properties - Min, Max etc.
for i := 1 to x do MyScrollComponent.AddObject(MyObject[i]); MyScrollComponent.UpdateStyle;
Hope this works for you too...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With