use the OnChange event instead of OnKeyPress.

for example:
procedure TMain.Edit1Change(Sender: TObject);
begin
  Edit1.Text := StringReplace(Edit1.Text, '^', '', [rfReplaceAll]);
end;

if you have several TEdits to do this with, you can use the same handler 
for all of them:
procedure TMain.EditAllChange(Sender: TObject);
begin
  TEdit(Sender).Text := StringReplace(TEdit(Sender).Text, '^', '', 
[rfReplaceAll]);
end;



[EMAIL PROTECTED] wrote:

>Hello,
>
>I have a character checker at OnKeyPress that controls like:
>
>if Key = '^' then
>    Key = #0;
>
>This works fine for keyboard input. However when the user copies a string 
>like 'qwerty^' to the clipboard and the right clicks the mouse on the 
>component and clicks on paste, it does not work! (the character is NOT 
>filtered). Is there a workaround for this problem?
>
>Best Regards,
>
>SZ 
>
>__________________________________________________
>Delphi-Talk mailing list -> [email protected]
>http://www.elists.org/mailman/listinfo/delphi-talk
>  
>
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to