keypress - C# check for Vowel -


this question has answer here:

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

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -