1 (edited by sonixax 2022-01-02 23:13:48)

Topic: OnKeyPress not working!

Hi,
I have a strange problem!
simply onKeyPress event not working! here is the script:

procedure Form1_OnKeyPress (Sender: TObject; var Key: Char);
begin
    ShowMessage('some text to test');
end;

also I can see my function name in in event tab of the form.

any Idea why its not working?

many thanks

Post's attachments

Attachment icon keypress.png 9.3 kb, 78 downloads since 2022-01-03 

Re: OnKeyPress not working!

Did you try checking the KeyPreview Option? This enables me the Onkeypress on a form.

Post's attachments

Attachment icon img.png 13.55 kb, 73 downloads since 2022-01-03 

brian