S
S
SG15542020-05-12 22:02:04
Keyboard
SG1554, 2020-05-12 22:02:04

How to disable all keys except letter and number keys?

How to block pressing certain keys in Windows forms, that is, the user presses trl or alt and the key does not

work

private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            e.SuppressKeyPress = true;
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#, 2020-05-12
@SG1554

https://docs.microsoft.com/en-us/dotnet/api/system...
https://docs.microsoft.com/en-us/dotnet/api/system...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question