Link to home
Start Free TrialLog in
Avatar of boardtc
boardtcFlag for Ireland

asked on

cursor at start of Tmemo

How can I move the cursor to the start of a TMemo, well actually the memeo is not editable so I hide the caret but I want the vertical scrollbar to be moved to the top when the click on something. Thanks, Tom.
ASKER CERTIFIED SOLUTION
Avatar of CalvinDay
CalvinDay

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CalvinDay
CalvinDay

Sorry,
SelLength:=0;
Avatar of kretzschmar
hi CalvinDay,

your answer does not work properly

hi tomcorcoran,

here is a better one

procedure TForm1.Button2Click(Sender: TObject);
begin
  Richedit1.Perform(EM_LineScroll,0,-Richedit1.Lines.Count); //Scroll to Begin
  Richedit1.SelStart := 0;                                   //Set Cursor
end;

remark: you must add richedit in the uses clause

meikl
Avatar of boardtc

ASKER

Calvin, thanks that worked, not sure why it didn't for meihl. Tom.
Maybe he was using a richedit instead of memo.
hi both,

CalvinDay has pointed it out,
just overlooked thats this is a tmemo-question,
sorry about this confusion.

meikl ;-)