During the KeyPress event, it takes any key pressed, but how would i make it to ONLY accept the "w" key for example?Code:private void Form1_KeyPress(object sender, KeyPressEventArgs e) { }
I tried using a case statement...
but i get an error of "Cannot implicitly convert type 'string' to 'bool'".Code:switch (KeyRestrictionBehavior.AllowOnly.Equals("w")) { case "w" : }
Am i doing this correctly? or is there a different way? And how would i correct the problem?