private void GameShowControl_Load(object sender, EventArgs e) { int h = Screen.PrimaryScreen.Bounds.Height; int w = Screen.PrimaryScreen.Bounds.Width; GameMenu gm1 = new GameMenu(UserID, UserName,Pass); if (w == 1024 && h == 768) { gm1.BackgroundImage = Properties.Resources._1024_768; } else { if (w==1280 && h==1024) { gm1.BackgroundImage = Properties.Resources._1280_1024; } else { if (w==1280 && h==800) { gm1.BackgroundImage = Properties.Resources._1280_800; } else { if (w==1366 && h ==768) { gm1.BackgroundImage = Properties.Resources._1366_768; } else { if (w==1600 && h == 900) { gm1.BackgroundImage = Properties.Resources._1600_900; } else { if (w==1920 && h==1080) { gm1.BackgroundImage = Properties.Resources._1920_1080; } else { gm1.BackgroundImage = Properties.Resources.bg; } } } } } } gm1.onClick_Setting += btn_Setting_onClick; gm1.onClick_Start += btn_Start_onClick; gm1.onClick_Help += gm1_onClick_Help; gm1.onClick_LogOut += gm1_onClick_LogOut; gm1.onHover_Exit += gm1_onHover_Exit; gm1.onHover_Help += gm1_onHover_Help; gm1.onHover_Setting += gm1_onHover_Setting; gm1.onHover_Start += gm1_onHover_Start; gm1.onClick_TurnOnMusic += gm1_onClick_TurnOnMusic; gm1.onClick_TurnOffMusic += gm1_onClick_TurnOffMusic; gm1.onClick_ImportMusic += gm1_onClick_ImportMusic; gm1.onClick_DefaultMusic += gm1_onClick_DefaultMusic; this.Controls.Add(gm1); try { axWindowsMediaPlayer1.URL = Directory.GetCurrentDirectory() + "\\Sound\\NhacNen.mp3"; axWindowsMediaPlayer1.Ctlcontrols.play(); axWindowsMediaPlayer1.settings.setMode("Loop", true); } catch (Exception) { } }
//exit help Control void Help_onExit(object sender, EventArgs e) { GameMenu gm1 = new GameMenu(UserID, UserName, Pass); int h = Screen.PrimaryScreen.Bounds.Height; int w = Screen.PrimaryScreen.Bounds.Width; if (w == 1024 && h == 768) { gm1.BackgroundImage = Properties.Resources._1024_768; } else { if (w == 1280 && h == 1024) { gm1.BackgroundImage = Properties.Resources._1280_1024; } else { if (w == 1280 && h == 800) { gm1.BackgroundImage = Properties.Resources._1280_800; } else { if (w == 1366 && h == 768) { gm1.BackgroundImage = Properties.Resources._1366_768; } else { if (w == 1600 && h == 900) { gm1.BackgroundImage = Properties.Resources._1600_900; } else { if (w == 1920 && h == 1080) { gm1.BackgroundImage = Properties.Resources._1920_1080; } else { gm1.BackgroundImage = Properties.Resources.bg; } } } } } } gm1.onClick_Setting += btn_Setting_onClick; gm1.onClick_Start += btn_Start_onClick; gm1.onClick_Help += gm1_onClick_Help; gm1.onClick_LogOut += gm1_onClick_LogOut; gm1.onHover_Exit += gm1_onHover_Exit; gm1.onHover_Help += gm1_onHover_Help; gm1.onHover_Setting += gm1_onHover_Setting; gm1.onHover_Start += gm1_onHover_Start; this.Controls.Clear(); this.Controls.Add(gm1); }
//Exit start Game void Exit_StartGame(object sender, EventArgs e) { try { //axWindowsMediaPlayer2.URL = (Directory.GetCurrentDirectory()) + "\\Sound\\Click.wav"; //axWindowsMediaPlayer2.Ctlcontrols.play(); } catch (Exception) { } try { //this.axWindowsMediaPlayer1.Ctlcontrols.play(); } catch (Exception) { } GameMenu gm1 = new GameMenu(UserID, UserName, Pass); int h = Screen.PrimaryScreen.Bounds.Height; int w = Screen.PrimaryScreen.Bounds.Width; if (w == 1024 && h == 768) { gm1.BackgroundImage = Properties.Resources._1024_768; } else { if (w == 1280 && h == 1024) { gm1.BackgroundImage = Properties.Resources._1280_1024; } else { if (w == 1280 && h == 800) { gm1.BackgroundImage = Properties.Resources._1280_800; } else { if (w == 1366 && h == 768) { gm1.BackgroundImage = Properties.Resources._1366_768; } else { if (w == 1600 && h == 900) { gm1.BackgroundImage = Properties.Resources._1600_900; } else { if (w == 1920 && h == 1080) { gm1.BackgroundImage = Properties.Resources._1920_1080; } else { gm1.BackgroundImage = Properties.Resources.bg; } } } } } } gm1.onClick_Setting += btn_Setting_onClick; gm1.onClick_Start += btn_Start_onClick; gm1.onClick_Help += gm1_onClick_Help; gm1.onClick_LogOut += gm1_onClick_LogOut; gm1.onHover_Exit += gm1_onHover_Exit; gm1.onHover_Help += gm1_onHover_Help; gm1.onHover_Setting += gm1_onHover_Setting; gm1.onHover_Start += gm1_onHover_Start; gm1.onClick_TurnOnMusic += gm1_onClick_TurnOnMusic; gm1.onClick_TurnOffMusic += gm1_onClick_TurnOffMusic; gm1.onClick_ImportMusic += gm1_onClick_ImportMusic; gm1.onClick_DefaultMusic += gm1_onClick_DefaultMusic; this.Controls.Clear(); this.Controls.Add(gm1); }