public TennisGame(MainMenuForm mainMenu) { InitializeComponent(); this.mainMenu = mainMenu; gameStatus = GAME_STATUS.IN_GAME; UserScore = 0; CompScore = 0; UserScoreLabel.Text = UserScore.ToString(); CompScoreLabel.Text = CompScore.ToString(); table = TablePanel.CreateGraphics(); userRacket = new UserRacket(this); compRacket = new CompRacket(this); ball = new Ball(this); TablePanel.Controls.Add(userRacket); TablePanel.Controls.Add(compRacket); TablePanel.Controls.Add(ball); userRacket.Show(); compRacket.Show(); ball.Show(); compRacket.Enabled = false; ball.Enabled = false; }
private void button2_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(LoginBox.Text) || String.IsNullOrEmpty(PasswordBox.Text)) { MessageBox.Show("Заполните все поля"); return; } else { string query = $"SELECT * FROM Users WHERE Login = '******' and Password = '******'"; DatabaseConnection dc = new DatabaseConnection(); loginAccess = dc.SqlCheck(query); if (loginAccess != null) { Saver.Role = loginAccess; MainMenuForm mainMenuForm = new MainMenuForm(); mainMenuForm.Show(); Hide(); } else { MessageBox.Show("Введите корректные данные"); } } }
public TanksGame(MainMenuForm mainMenu) { InitializeComponent(); Buttons.AddRange(new[] { level1Button, level2Button, level3Button, level4Button, }); GameStatus = GAME_STATUS.LEVEL_SELECT; MainMenu = mainMenu; Size = new Size(350, 150); WindowState = FormWindowState.Normal; reloadTimer.Interval = reloadTimerMs; compTanksActionWorker.Interval = compTankStepTimer; resultGameChecker.Interval = resultGameCheckerMs; bulletsMoveWorker.Interval = bulletStepTimer; gunLabel.Text = ""; debugLabel.Text = ""; mouseLabel.Text = ""; gunLabel.Location = new Point(gameFieldLocationX + gameFieldWidth + 25, gunLabel.Location.Y + gameFieldLocationY + 25); debugLabel.Location = new Point(gameFieldLocationX + gameFieldWidth + 25, debugLabel.Location.Y + gameFieldLocationY + 25); mouseLabel.Location = new Point(gameFieldLocationX + gameFieldWidth + 25, mouseLabel.Location.Y + gameFieldLocationY + 25); debugTimer.Interval = 300; debugTimer.Start(); }
static FormPool() { UIManageable form = null; form = new MainMenuForm(); InitMainMenu(form); }
private void GotoScreen(ScreenType targetScreenType) { currentScreenType = targetScreenType; switch (targetScreenType) { case ScreenType.Welcome: _ = new WelcomeForm { panel1 = { Parent = panel1 } }; break; case ScreenType.StatusBarCommon: _ = new StatusBarCommonForm { panel1 = { Parent = panel1 } }; StatusBar = statusBar1; break; case ScreenType.MainWindowCommon: _ = new MainMenuForm(this) { panel1 = { Parent = panel1 } }; break; case ScreenType.TextBox: MainMenu.Items.Clear(); _ = new TextBoxForm { panel1 = { Parent = panel1 } }; break; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); BaseForm form = new MainMenuForm(); BaseForm formToShowNext = null; int leftPosition = 0; int topPosition = 0; while (form != null) { using (form) { form.StartPosition = FormStartPosition.Manual; form.Top = topPosition; form.Left = leftPosition; Application.Run(form); formToShowNext = form.FormToOpenNext; // Prevents the GUI from jumping around as you switch forms leftPosition = form.Left; topPosition = form.Top; } form = formToShowNext; } }
private void btnLogin_Click(object sender, EventArgs e) { if (txtUsername.Text == null) { MessageBox.Show(SportRegistrationSystem.lblInvalidLogin); } else { if (txtPassword.Text == null) { MessageBox.Show(SportRegistrationSystem.lblInvalidPassword); } else { List <StaffClass> loginStatus = StaffBll.Login(txtUsername.Text, txtPassword.Text); if (loginStatus.Count() == 1) { MainMenuForm form = new MainMenuForm(loginStatus); form.Show(); this.Hide(); } else { MessageBox.Show(SportRegistrationSystem.lblLoginFailed); } } } }
private void returnToMenu_Click(object sender, EventArgs e) { this.Hide(); MainMenuForm m = new MainMenuForm(); m.Closed += (s, args) => this.Close(); m.Show(); }
private void mainMenuButton_Click(object sender, EventArgs e) { gb.Hide(); this.Hide(); MainMenuForm m = new MainMenuForm(); m.Closed += (s, args) => this.Close(); m.Show(); }
public FourInARowGame() { MainMenuForm mainMenuForm = new MainMenuForm(k_MinDimension, k_MaxDimension); mainMenuForm.ShowDialog(); if (mainMenuForm.DialogResult == DialogResult.OK) { OnStart(mainMenuForm.GameSettings); } }
public void ShowMovieList() { // create an object of MainMenuForm MainMenuForm mmf = new MainMenuForm(cinema, currentUser); // switch to tPageViewMemberList mmf.MoviesTabCtrl.SelectedTab = mmf.MoviesTabCtrl.TabPages[8]; // display MainMenuForm object created mmf.ShowDialog(); }
public void ViewPaymentHistory() { // create an object of MainMenuForm MainMenuForm mmf = new MainMenuForm(cinema, currentUser); // switch to tPageView mmf.MoviesTabCtrl.SelectedTab = mmf.MoviesTabCtrl.TabPages[10]; // display MainMenuForm object created mmf.ShowDialog(); }
public SnakeGame(MainMenuForm mainMenu) { InitializeComponent(); this.mainMenu = mainMenu; snakePanel.Hide(); scoreLabel.Hide(); resLabel.Hide(); pauseGameButton.Hide(); endGameButton.Hide(); }
public void RedeemBonus() { // create an object of MainMenuForm MainMenuForm mmf = new MainMenuForm(cinema, currentUser); // switch to tPageRedeemBonus mmf.MoviesTabCtrl.SelectedTab = mmf.MoviesTabCtrl.TabPages[6]; mmf.btnChooseSpecificMovie.Visible = false;// for purchase ticket // display MainMenuForm object created mmf.ShowDialog(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); loginForm = new LoginForm(); orderproductForm = new OrderProductForm(); mainmenuForm = new MainMenuForm(); historyworkedForm = new HistoryWorkedForm(); dairymenuForm = new UpdateDairyMenuForm(); Application.Run(mainmenuForm); }
// instance methods // view seat status for specific movie public void ViewSeatsForSpecificMovie() { // create an object of MainMenuForm MainMenuForm mmf = new MainMenuForm(cinema, currentUser); // switch to tPageChooseSpecificMovie mmf.MoviesTabCtrl.SelectedTab = mmf.MoviesTabCtrl.TabPages[0]; mmf.btnChooseSpecificMovie.Visible = true;// for purchase ticket // display MainMenuForm object created mmf.ShowDialog(); }
public FormsManager(GUIForm guiForm) { MainMenu = new MainMenuForm(guiForm, this); Game = new GameForm(guiForm, this); StageNumber = new StageNumberForm(guiForm, this); GameOver = new GameOverForm(guiForm, this); Construction = new ConstructionForm(guiForm, this, Game.Field); Options = new OptionsForm(guiForm, this); Records = new RecordsForm(guiForm, this); ActiveForm = MainMenu; SetMainMenuForm(); }
public TetrisGame(MainMenuForm mainMenu) { InitializeComponent(); this.mainMenu = mainMenu; tetrisGamePanel.Hide(); nextFigurePanel.Hide(); ScoreHeaderLabel.Hide(); StartGameButton.Show(); InfoButton.Show(); Size = new Size(280, 280); }
public TanksGame(MainMenuForm mainMenu) { InitializeComponent(); buttons.Add(level1Button); buttons.Add(level2Button); buttons.Add(level3Button); buttons.Add(level4Button); this.mainMenu = mainMenu; gameStatus = GAME_STATUS.LEVEL_SELECT; Size = new Size(350, 150); TanksGame.gameRef = this; }
public static UIManageable GetForm(Views view) { UIManageable form = null; if (pool.ContainsKey(view)) { form = pool[view]; if (form.IsDisposed) { pool.Remove(view); } else { form = InitForm(form, view); return(form); } } switch (view) { case Views.MainMenuForm: case Views.LoginForm: case Views.RegistrationForm: case Views.OptionsForm: case Views.ChatForm: case Views.UserInfoForm: case Views.ChooseGameForm: case Views.CreateGameForm: case Views.WaitingForPlayersForm: case Views.PauseForm: case Views.GameMenuForm: form = new MainMenuForm(); form.Hide(); InitMainMenu(form); break; case Views.GameForm: form = new GameForm(); pool.Add(view, form); break; default: break; } return(form); }
public StudentAuthForm(MainMenuForm parent) { InitializeComponent(); this.parent = parent; groupsTable = groupsTableAdapter.GetData(); studentsTable = studentsTableAdapter.GetData(); foreach (DataRow group in groupsTable.Rows) { groupsBox.Items.Add(group["GroupNumber"]); } if (groupsBox.Items.Count > 0) { groupsBox.SelectedIndex = 0; } }
public static void StartUp(bool login = true) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form form; if (login) { form = new LoginForm(); } else { form = new MainMenuForm(); } form.Show(); Application.Run(); }
void autorun(bool creator = true) { isAutorun = false; playerName = autorunName; if (creator) { //Connect connectionManager.parseRequest(Messages.GameMessages.connect, new List <object> { autorunName }, this); //Load character XmlDocument doc = MainMenuForm.loadCharacterFromXml(); if (doc == null) { return; } loadCharacterFromXml(doc, 1); //Create match createMatch(null); //Lock in setPlayerReady(); } else { //Connect connectionManager.parseRequest(Messages.GameMessages.connect, new List <object> { autorunName }, this); //Load character XmlDocument doc = MainMenuForm.loadCharacterFromXml(); if (doc == null) { return; } loadCharacterFromXml(doc, 2); //Update to get exising matches sendUpdateDataRequest(); //Join first match in list joinMatch(new List <object> { matches[0] }); //Lock in setPlayerReady(); } }
// view seat status for all movies public void ViewSeatsForAllMovies() { //// get the movieList from the cinema object //Movie[] movies = cinema.GetMovieList(); // create an object of MainMenuForm MainMenuForm mmf = new MainMenuForm(cinema, currentUser); // set the Visible property of btnRedeem1, btnRedeem2 and btnRedeem3 to false mmf.btnRedeem1.Visible = false; mmf.btnRedeem2.Visible = false; mmf.btnRedeem3.Visible = false; // switch to tPageMovie1 mmf.MoviesTabCtrl.SelectedTab = mmf.MoviesTabCtrl.TabPages[1]; // display MainMenuForm object created mmf.ShowDialog(); }
private void LoginButton_Click(object sender, EventArgs e) { var login = LoginTextBox.Text; var password = PasswordTextBox.Text; var task = new Task <bool>(() => Аuthorization(login, password)); task.Start(); if (!task.Result) { RadMessageBox.Show(@"Пользователь с таким логином не найден"); } else { var frm = new MainMenuForm(); frm.Closed += (s, args) => this.Show(); frm.Show(); this.Hide(); } }
public TennisGame(MainMenuForm mainMenu) { InitializeComponent(); this.mainMenu = mainMenu; gameStatus = GAME_STATUS.IN_GAME; table = TablePanel.CreateGraphics(); userRacket = new UserRacket(this); compRacket = new CompRacket(this); ball = new Ball(this); TablePanel.Controls.Add(userRacket); TablePanel.Controls.Add(compRacket); TablePanel.Controls.Add(ball); userRacket.Show(); compRacket.Show(); ball.Show(); }
static void formTesting(string arg = null) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IClientConnectionManager manager = new WCFClientManager(); MainMenuForm mainForm = new MainMenuForm(); mainForm.Text = arg ?? "Form"; ConnectToServerForm connectForm = new ConnectToServerForm(); manager.FeedbackWriter = mainForm; MainMenuController controller = new MainMenuController(manager, mainForm, connectForm); controller.MyMatchFormController = new GraphicMatchController(); controller.PlayerName = arg; controller.start(); //controller.setCurrentForm("Dispute"); Application.Run((MainMenuForm)controller.MyView); }
public TennisGame(MainMenuForm mainMenu) { InitializeComponent(); this.mainMenu = mainMenu; Table = TablePanel.CreateGraphics(); UserRacket = new UserRacket(this); CompRacket = new CompRacket(this); Ball = new Ball(this); TablePanel.Controls.Add(UserRacket); TablePanel.Controls.Add(CompRacket); TablePanel.Controls.Add(Ball); UserRacket.Show(); CompRacket.Show(); Ball.Show(); UserRacket.Enabled = false; RestartButton.Focus(); }
public TanksGame(MainMenuForm mainMenu) { InitializeComponent(); buttons.AddRange(new[] { level1Button, level2Button, level3Button, level4Button, }); this.mainMenu = mainMenu; Size = new Size(350, 150); reloadTimer.Interval = reloadTimerMs; compTanksActionWorker.Interval = compTankStepTimer; resultGameChecker.Interval = resultGameCheckerMs; bulletsMoveWorker.Interval = bulletStepTimer; gunLabel.Text = "Gun: Ready"; debugTimer.Interval = 300; debugTimer.Start(); }
private void ButtonLogin_Click(object sender, EventArgs e) { //Adding the Username and Password to a static Class ////UserPresenter.SetUserLoginData(TextBoxUsername.Text, TextBoxPassword.Text); //Logging in to the Main Menu Form // bool exists = LoginService.CheckIf(TextBoxUsername.Text, TextBoxPassword.Text); if (NetTest()) { if (LoginService.LoginUser(TextBoxUsername.Text, TextBoxPassword.Text)) { MainMenuForm mainMenuForm = new MainMenuForm(); mainMenuForm.Show(); this.Hide(); } else { LabelMessage.Text = "Username or password is wrong! Please enter the correct credentials!"; } } else { MessageBox.Show("Please secure an internet connections before using GNA"); } }
// This method is run when the mainboard is powered up or reset. void ProgramStarted() { /******************************************************************************************* BLITZKRIEG 0.1 - PROGRAM CONTOH PEMANFAATAN GADGETEER SEBAGAI DEVICE MULTI-FUNGSI *******************************************************************************************/ Debug.Print("Program Started"); //init pins boardPins = new Hashtable(); for (int i = 1; i <= 10; i++) { var pin = new BoardPins(); pin.PinType = BoardPins.PinTypes.None; pin.ThisPin = null; boardPins.Add(i, pin); } SetupBackgroundService(); Screens = new Hashtable(); //populate all form var F1 = new SplashForm(ref MainWindow); F1.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.Splash, F1); var F2 = new MainMenuForm(ref MainWindow); F2.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.MainMenu, F2); var F3 = new MyRoomForm(ref MainWindow, ref tempHumidSI70, ref lightSense); F3.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.MyRoom, F3); var F4 = new InboxForm(ref MainWindow, ref cellularRadio, ref sdCard, ref displayTE35); F4.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.Inbox, F4); var F5 = new GalleryForm(ref MainWindow, ref serialCameraL1, ref sdCard, ref wifiRS21); F5.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.Gallery, F5); var F6 = new GameForm(ref MainWindow, ref displayTE35); F6.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.Game, F6); var F7 = new RegisterForm(ref MainWindow, ref wifiRS21, ref sdCard); F7.FormRequestEvent += General_FormRequestEvent; Screens.Add(Screen.ScreenTypes.Register, F7); Glide.FitToScreen = true; GlideTouch.Initialize(); //load splash LoadForm(Screen.ScreenTypes.Splash); }