Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to scroll Memo or RichEdit?

234 views
Skip to first unread message

Konstantin Dzreyev

unread,
Jul 7, 1999, 3:00:00 AM7/7/99
to
Hi all!

Does anybody know how to scroll Memo or RichEdit (maybe send any
message). And how to set a position for a caret.

Thanks.


Jon T. Camp

unread,
Jul 7, 1999, 3:00:00 AM7/7/99
to
Hello Konstantin,

To set caret position use the SelStart property.

To scroll, Perform one of the scrolling messages, such as EM_LINESCROLL,
EM_SCROLL, or EM_SCROLLCARET.

HTH

Regards,

Jon T. Camp
Applied Research Associates
jc...@ara.com


Konstantin Dzreyev <colo...@chat.ru> wrote in message
news:378318F2...@chat.ru...

Peter Below (TeamB)

unread,
Jul 7, 1999, 3:00:00 AM7/7/99
to
> Does anybody know how to scroll Memo or RichEdit (maybe send any
> message).

Send WM_VSCROLL messages to the control. Or EM_SCROLL or EM_LINESCROLL,
whatever fits your needs best. See win32.hlp for a description of these
messages.

> And how to set a position for a caret.

Set the SelStart property.

Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!


Petio Tonev

unread,
Jul 8, 1999, 3:00:00 AM7/8/99
to
Hi, Konstantin.

To scroll you can try this:

memoEditor.Perform(EM_SCROLL,scAction, 0);

scAction is:
SB_LINEDOWN - Scrolls down one line.
SB_LINEUP - Scrolls up one line.
SB_PAGEDOWN - Scrolls down one page.
SB_PAGEUP - Scrolls up one page.

To set caret position I don't konw message. I make this that:

procedure TMainF.GoToLine(NewLine :LongInt);
var
LineLoop :LongInt;
SelStart :LongInt;
begin
LineLoop:= 0; SelStart:= 0;
if (NewLine > Editor.Lines.Count) then exit;
while not(LineLoop = (NewLine- 1)) do
begin
SelStart:= SelStart+ Length(Editor.Lines.Strings[LineLoop])+ 2;
Inc(LineLoop);
end;
Editor.SelStart:= SelStart;
end;

Regard.

ps. I'm sorry for my very bad English.
--
Petio Tonev
pto...@iname.com
www.i.am/ptonev , www.w3.to/tonevsoft


0 new messages