-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
  • 38,411
  • 12
  • 59
  • 178
Signum21
  • 31
  • 1
  • 9

1 Answers1

0

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

David Jones
  • 2,879
  • 2
  • 18
  • 23