static void Main() { List<string> fruitList = new List<string>(); bool IsMenuActive = true; while (IsMenuActive) { //Console.WriteLine("MainMenu\\"); Console.WriteLine("[1] - Menu1"); Console.WriteLine("[2] - Menu2"); Console.WriteLine("[3] - Menu3"); Console.WriteLine("[4] - Menu4"); Console.WriteLine(); ValidKeyPress(); } static char ValidKeyPress() { Console.Write("Choose menu: "); char userInput = Console.ReadKey().KeyChar; while (!char.IsDigit(userInput)) { Console.WriteLine(); Console.Write("Wrong keypress, try again: "); userInput = Console.ReadKey(true).KeyChar; Console.Write(userInput); } Console.WriteLine(); return userInput; }