ALT-key blocking query

  • Thread starter Thread starter Patrick De Ridder
  • Start date Start date
P

Patrick De Ridder

In order to block using the ALT butto,

I use

tb.KeyPress += etc

and

a function containing

if(e.KeyChar == (char)56)
e.Handled is true;

No syntax errors,
however, this isn't working.

Please comment.
Thank you,
Patrick.
 
Patrick,

The KeyPress event doesn't handle the ALT key. Rather, you will have to
use the KeyDown and KeyUp events to handle that key.

Hope this helps.
 
Thanks. I'll give it a try.

Patrick.


Nicholas Paldino said:
Patrick,

The KeyPress event doesn't handle the ALT key. Rather, you will have to
use the KeyDown and KeyUp events to handle that key.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Patrick De Ridder said:
In order to block using the ALT butto,

I use

tb.KeyPress += etc

and

a function containing

if(e.KeyChar == (char)56)
e.Handled is true;

No syntax errors,
however, this isn't working.

Please comment.
Thank you,
Patrick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top