| | |
OnKeyPress Event
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2007
Posts: 6
Reputation:
Solved Threads: 0
Can anyone explain why the OnKeyPress Event does not work with a TButton on the same Form. What am I doing wrong?
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption:='button';
end;
procedure TForm1.KeyPress(Sender: TObject; var Key: Char);
begin
if Key='a' then Label1.Caption:='OK';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption:='button';
end;
procedure TForm1.KeyPress(Sender: TObject; var Key: Char);
begin
if Key='a' then Label1.Caption:='OK';
end;
![]() |
Similar Threads
- Enter to tab (Pascal and Delphi)
- event object (HTML and CSS)
- Error when making an event procedure in Visual Basic (C)
- Event List for Car Show Fan Site - (PHP)
- Win XP Pro - Event Log (Windows NT / 2000 / XP)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: On MouseHover events?
- Next Thread: Would someone be willing to point me to a good reference on how to use the IdFTP?
| Thread Tools | Search this Thread |
Tag cloud for Pascal and Delphi





