Hi everyone,
I'm encountering a strange issue in my application and was hoping someone here might have a solution or workaround.
When I scroll a focused TEdit control out of the viewable area within a TVertScrollBox, I get an uncaught EArgumentOutOfRangeException.
Steps to Reproduce:
Create a new FMX application.
Add a TVertScrollBox to the main form.
Add a TEdit control inside the TVertScrollBox.
Make sure the TVertScrollBox is scrollable by adding enough content to enable scrolling.
Focus the TEdit control by clicking on it.
Scroll the focused TEdit control completely out of the viewable area of the TVertScrollBox.
Sometimes it takes several scrolling attempts to reproduce the problem but 7 times out of 10 I get this error.
So far I have been able to reproduce the problem on Windows, Android and IOS.
Error Message:
List index out of range (1). TList<FMX.Controls.TControl> range is 0..0
Stacktrace:
'Call Stack Information
[00D18342] FMX.Forms.TCustomForm.PaintRects (Line 6421, "FMX.Forms.pas")
[00CADD26] FMX.Platform.Win.WMPaint (Line 1777, "FMX.Platform.Win.pas")
[00CADDD1] FMX.Platform.Win.WMPaint (Line 1789, "FMX.Platform.Win.pas")
[00CADDF1] FMX.Platform.Win.WMPaint (Line 1795, "FMX.Platform.Win.pas")
[00CADE53] FMX.Platform.Win.WMPaint (Line 1801, "FMX.Platform.Win.pas")
[00CAF2C9] FMX.Platform.Win.WndProc (Line 2353, "FMX.Platform.Win.pas")
[00CB0347] FMX.Platform.Win.WndProc (Line 2804, "FMX.Platform.Win.pas")
[00CB0659] FMX.Platform.Win.WndProc (Line 2890, "FMX.Platform.Win.pas")
[758D93B8] USER32 (possible GetWindowLongW+264)
[00C4FE11] FMX.Platform.Screen.Win.TWinMultiDisplay.PxToDp (Line 440, "FMX.Platform.Screen.Win.pas")
[00CB1E2C] FMX.Platform.Win.TPlatformWin.ClientToScreen (Line 3597, "FMX.Platform.Win.pas")
[758D9331] USER32.GetWindowLongW
[00D107C9] FMX.Forms.TCommonCustomForm.ClientToScreen (Line 4863, "FMX.Forms.pas")
[7759AF04] ntdll.RtlRestoreLastWin32Error
[6E2D9E7B] uxtheme (possible GetThemeBackgroundRegion+6027)
[6E2E00EC] uxtheme (possible GetThemePartSize+9084)
[758E1B49] USER32 (possible AddClipboardFormatListener+73)
[758D7F65] USER32 (possible GetClassLongW+1973)
[758D7D78] USER32 (possible GetClassLongW+1480)
[758D81A9] USER32 (possible GetClassLongW+2553)
[758D7B55] USER32 (possible GetClassLongW+933)
[758DC05D] USER32 (possible CallNextHookEx+413)
[775B54EB] ntdll (possible KiUserCallbackDispatcher+75)
[758D69C3] USER32 (possible DispatchMessageW+1571)
[00629CF4] System.TMonitor.CheckOwningThread (Line 19915, "System.pas")
[758DC269] USER32.PeekMessageW
[758D63AB] USER32.DispatchMessageW
[00CABA41] FMX.Platform.Win.TPlatformWin.HandleMessage (Line 846, "FMX.Platform.Win.pas")
[00D07BFE] FMX.Forms.TApplication.HandleMessage (Line 1940, "FMX.Forms.pas")
[00D07C28] FMX.Forms.TApplication.HandleMessage (Line 1943, "FMX.Forms.pas")
[00CAB802] FMX.Platform.Win.TPlatformWin.Run (Line 750, "FMX.Platform.Win.pas")
[00D088CC] FMX.Forms.TApplication.Run (Line 2268, "FMX.Forms.pas")
[00D088E5] FMX.Forms.TApplication.Run (Line 2269, "FMX.Forms.pas")
Has anyone else experienced this issue or does anyone have any suggestions on how to fix it? Any help would be greatly appreciated!
Thanks in advance!