المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# Console Application



C# Programming
05-13-2009, 10:11 PM
What I'm looking is a source code to show me how to make and use menus. Here's a
sample of what I have. and Some of it works and some of it doesn't

--------------------------------------------------------

//Main Menu
MainMenu:
terminal.ClearScreen();
terminal.WriteLine();
terminal.WriteLine("Welcome :" + name);
terminal.WriteLine("1) Game Menu");
terminal.WriteLine("2) N/A");
terminal.WriteLine("3) Help");
terminal.WriteLine("9) Quit");
terminal.TranslateFile("Menu.txt", true);
terminal.Write("Choice : (1,2,3 0r 9)");
int caseSwitch = terminal.ReadDigit();
switch (caseSwitch)
{
case 1:
Functions NewGame = new Functions();
NewGame.GameMenu();
goto MainMenu;
case 2:
terminal.WriteLine("Case 2");
goto MainMenu;
case 9:
break;
default:
terminal.WriteLine("Invalid Key");
terminal.PromptEnter("Press ENTER to Continue..");
goto MainMenu;
}

------------------------------------------------