Uhhh, looks like Delhi/Lazarus - is not so suitable for programming like VC++/MFC it was(((I could not find that, where would that be?
No, this functions directly belongs to MFC/Visual C++ coding style, but I was hoping that the
chosen Object Pascal will have something similar on board... But looks like it's not. Sorry.
Something like that did you try?
Code: Select all
procedure <anObject>.KeyPress(Sender: TObject; var Key: Char);
begin
if Key = ^A then
begin
// Select all mode is ON
(Sender as TEdit).SelectAll;
// or PostMessage(<EditObjectName>.Handle, EM_SETSEL, 0, -1);
Key := #0;
end;
end;