OnKeyPress (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This event handler displays a message dialog box specifying which key was pressed.

Code

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
  MessageDlg(Key + ' has been pressed', mtInformation, [mbOK], 0)
end;

Uses