Page 1 of 1

Scroll horizontally to item

Posted: Sat Nov 12, 2022 12:44 am
by jgkoehn
I have a RichViewEdit that only has horizontal scroll.
Ideas on how best to scroll an item into view on the horizontal scroll.
Something like
ScrollHorizontalTo(ItemNo)

Re: Scroll horizontally to item

Posted: Sat Nov 12, 2022 11:22 am
by Sergey Tkachenko

Code: Select all

var
  R: TRect;

  RichViewEdit1.GetItemCoordsEx(RichViewEdit1.RVData, ItemNo, 0, True, R);
  RichViewEdit1.HScrollPos := R.Left;
(For FMX, TRectF instead of TRect.