keypress - C# check for Vowel -
this question has answer here:
- listen key press in .net console app 8 answers
i want check if user input vowel. if other key pressed, error should shown. here's have far. how can add other keys? current output: "key pressed" a
static void main(string[] args) { consolekeyinfo a; while (true) { = console.readkey(); if (a.key == consolekey.a); { console.writeline("a"); } } }
you can try this:
protected override bool processcmdkey(ref message msg, keys keydata) { if (keydata == keys.f3) { //do something; } if(keydata ==keys.escape) { //do something; } if(keydata ==keys.f2) { //do something; } return false; }
Comments
Post a Comment