-1

I have a menu that switch the options by pressing the UpArrow and the DownArrow, i want to prevent the user from entering letters or numbers or any key that print something on the screen.

I was thinking to set the cursor position at the end of the text and than print a white space but it prints the letter after the white space, maybe if there's an event that occurs after the letter is printed on screen.

Any ideas?

Ňɏssa Pøngjǣrdenlarp
  • 37,829
  • 11
  • 57
  • 166
Signum21
  • 31
  • 1
  • 9

1 Answers1

0

You can use Console.ReadKey(intercept: true) to get a key without echoing it to the console.

djones
  • 2,363
  • 1
  • 16
  • 21