Does anybody know how to scroll Memo or RichEdit (maybe send any
message). And how to set a position for a caret.
Thanks.
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...
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!
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