Page 1 of 1

Problem with selecting in OnEnter event

Posted: Wed Feb 14, 2007 10:34 pm
by DickBryant
Hi Sergey,

I'm using the following code to select certain text if it exists upon entering an rve:

AQDMemo.Format;
if ((GetAllText(AQDMemo) = 'Insert your new answer text here')
or (Pos('dummy answer', GetAllText(AQDMemo)) > 0)
or (GetAllText(AQDMemo) = '')) then
begin
AQDMemo.SelectAll;
AQDMemo.ApplyTextStyle(2);
end;

This works fine if the rve is entered by tabbing. But if I click with the mouse to enter the rve I can see that the text is indeed selected as long as I hold down the mouse button, but as soon as I let go, the text deselects.

Any suggestions on getting the selection to 'stick'?

Thanks!