Hello I'm trying to make a program in WF that uses the KeyPress event. I've written the following code:
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
while (true)
{
switch (e.KeyChar)
{
case (char)68:
MessageBox.Show("Test");
break;
}
}
}
But when I execute the program and press the key the message box doensn;t appear. Does anyone have any suggestions or knows how to fix this? I've also been told that a KeyDown event could work but I don't know how to work with those either.