How to avoid scroll on SetSelectionBounds?

General TRichView support forum. Please post your questions here
Post Reply
enzogupi
Posts: 4
Joined: Mon Jul 13, 2009 7:56 am

How to avoid scroll on SetSelectionBounds?

Post by enzogupi »

When I select a part of text that is partially not visible the editor scolls to bring all selection into view. Is there a way to avoid this?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

There are no methods to disallow scrolling on selection.
You can do the following:

Code: Select all

vp := rve.VScrollPos;
hp := rve.HScrollPos;
rve.BeginUpdate;
<select here>
rve.VScrollPos := vp;
rve.HScrollPos := hp;
rve.EndUpdate;
enzogupi
Posts: 4
Joined: Mon Jul 13, 2009 7:56 am

Post by enzogupi »

Sergey Tkachenko wrote:There are no methods to disallow scrolling on selection.
You can do the following:

Code: Select all

vp := rve.VScrollPos;
hp := rve.HScrollPos;
rve.BeginUpdate;
<select here>
rve.VScrollPos := vp;
rve.HScrollPos := hp;
rve.EndUpdate;
It works... thanks
Post Reply