Search code examples
c++c++builderfiremonkey

How to scroll current view to specific line in FMX Memo in C++ Builder?


I'd like to scroll the current view to specific line in FMX Memo. I used to use below code in VCL component:

TopVisibleRow = SendMessage(LogMemo->Handle, EM_GETFIRSTVISIBLELINE, 0, 0);
SendMessage(LogMemo->Handle, EM_LINESCROLL, 0 , TargetLine - TopVisibleRow));

Is there any method to jump to specific line in FMX memo for cross-platform application?

I'm using C++ Builder Berlin Update 2.


Solution

  • Below code works in FMX:

    Memo1->CaretPosition = TCaretPosition::Create(ROW_NUM, 0);