Board index » delphi » Tmemo bring selection in visible part of windows

Tmemo bring selection in visible part of windows

Hi,

After selecting a string in a Tmemo I should want to see it in the visible
part of the window. How can I make the window scrolling until I see this
line?

Thanks by advance.

D.L.B.

dlebo...@ac-idf.jussieu.fr

 

Re:Tmemo bring selection in visible part of windows


You can tell the Memo to scroll to an x,y location with the ScrollBy(x,y)
method. See Help for more info.

- Dave Lively
Intelemedia Communications
d...@intelemedia.com

Quote
Daniel Le Boit wrote in message <7830ia$c...@forums.borland.com>...
>Hi,

>After selecting a string in a Tmemo I should want to see it in the visible
>part of the window. How can I make the window scrolling until I see this
>line?

>Thanks by advance.

>D.L.B.

>dlebo...@ac-idf.jussieu.fr

Re:Tmemo bring selection in visible part of windows


Daniel,

 Memo1.Perform(EM_SCROLLCARET, 0, 0);
--
Regards
Ralph (TeamB)
--

Quote
Daniel Le Boit wrote in message <7830ia$c...@forums.borland.com>...

|After selecting a string in a Tmemo I should want to see it in the visible
|part of the window. How can I make the window scrolling until I see this
|line?

Re:Tmemo bring selection in visible part of windows


Ralph :

I did the perform you suggest and this work fine with D2.
But on D1 (for application compatibility with win3.1) I did'nt found
EM_SCROLLCARET message.
I look for analog message for EM and did'nt found anything. Do you know a
solution compatible with D1 version?
I begin to understand what are WM messages!
Thank for your Help.

Quote

> Memo1.Perform(EM_SCROLLCARET, 0, 0);
>--

Re:Tmemo bring selection in visible part of windows


Hi

thank to ralph for help!

I found the solution for scrolling window until caret become visible in a
Tmemo (D1 version). I wrote this :

var
  DebFin : Longint;

  begin
     DebFin:=(65536*(Form1.Memo1.SelStart+Form1.Memo1.SelLength))
+Form1.Memo1.Selstart;
     Form1.Memo1.Perform(EM_SETSEL,0,DebFin);
  end;

Other Threads