boardtc
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hi CalvinDay,
your answer does not work properly
hi tomcorcoran,
here is a better one
procedure TForm1.Button2Click(Sender : TObject);
begin
Richedit1.Perform(EM_LineS croll,0,-R ichedit1.L ines.Count ); //Scroll to Begin
Richedit1.SelStart := 0; //Set Cursor
end;
remark: you must add richedit in the uses clause
meikl
your answer does not work properly
hi tomcorcoran,
here is a better one
procedure TForm1.Button2Click(Sender
begin
Richedit1.Perform(EM_LineS
Richedit1.SelStart := 0; //Set Cursor
end;
remark: you must add richedit in the uses clause
meikl
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 ;-)
CalvinDay has pointed it out,
just overlooked thats this is a tmemo-question,
sorry about this confusion.
meikl ;-)
SelLength:=0;