Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I have designed a calculator but need to intercept all keyboard keys

0 views
Skip to first unread message

Shaggy

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to
I have designed a calculator program with 10 keys for the numbers plus
the usual other key for the maths part i used to have a tlabel for the
sum but i thought of having a editbox to use instead so if i press any
of the buttons on the screen it alters the editbox text or if i enter
a number from the keyboard. how can i intercept all keyboard keys from
wherever in the form you have highlighted.

Thanks in Advance

Karl

Ingo Schulz

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to

Hi!

Try using the property KeyPreview := true (I think) from your main form.
It gets all keys from child controls. Just look for this property in the
online-help.

Ingo

grust

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to

Shaggy wrote<8FjxN9IsvOhB5PGfeQqCV754=G...@4ax.com>...

>I have designed a calculator program with 10 keys for the numbers plus
>the usual other key for the maths part i used to have a tlabel for the
>sum but i thought of having a editbox to use instead so if i press any
>of the buttons on the screen it alters the editbox text or if i enter
>a number from the keyboard. how can i intercept all keyboard keys from
>wherever in the form you have highlighted.


Use the form's OnShortCut event.

ged

unread,
Sep 29, 1999, 3:00:00 AM9/29/99
to
hi Shaggy

Form1.KeyPreview := true;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
etc.

you'll need to set your edit box to read only.

hth

__
Ged

0 new messages