/*初始化與視窗控制*/ public endform(Form1 menu, gameform form) { InitializeComponent(); gameform = form; gameform.getresult = "endgame"; form1 = menu; fontcollection.AddFontFile(Application.StartupPath + "\\新特明體.TTC"); Font font = new Font(fontcollection.Families[0], 20); this.Font = font; }
private void button2_Click(object sender, EventArgs e) { gameformboss gameformbackground = new gameformboss(); gameform gameform = new gameform(); gameformbackground gameformbackground1 = new gameformbackground(); GameData.gameformbackground = gameformbackground; GameData.gameform = gameform; gameform.GetForm1 = this; gameform.GetGameformbackground = gameformbackground1; gameformbackground.getformposition = new Point(this.Location.X, this.Location.Y); gameformbackground.getgameformsize = gameform.returnthisformsize; gameform.getfromlocation = new Point(this.Location.X, this.Location.Y); gameformbackground1.Show(); gameformbackground.Show(); gameform.Show(); this.Visible = false; }
/*事件監聽器*/ private void debugtext_TextChanged(object sender, EventArgs e) { if (debugtext.Text == "again") { gameformboss gameformbackground = new gameformboss(); gameform gameform = new gameform(); gameformbackground gameformbackground1 = new gameformbackground(); GameData.gameformbackground = gameformbackground; GameData.gameform = gameform; gameform.GetForm1 = this; gameform.GetGameformbackground = gameformbackground1; gameformbackground.getformposition = new Point(this.Location.X, this.Location.Y); gameformbackground.getgameformsize = gameform.returnthisformsize; gameform.getfromlocation = new Point(this.Location.X, this.Location.Y); gameformbackground1.Show(); gameformbackground.Show(); gameform.Show(); debugtext.Text = "debugtext"; } }
public pauseform(gameform game) { InitializeComponent(); int distance; gameform = game; fontcollection.AddFontFile(Application.StartupPath + "\\新特明體.TTC"); Font font = new Font(fontcollection.Families[0], 18); label1.Font = font; restart.Font = font; label1.Left = ((this.Width - 20) / 2) - (label1.Width / 2); continuegame.Left = ((this.Width - 20) / 2) - (continuegame.Width / 2); restart.Left = ((this.Width - 20) / 2) - (restart.Width / 2); backtomenu.Left = ((this.Width - 20) / 2) - (backtomenu.Width / 2); distance = (this.Height - 40 - label1.Height - continuegame.Height - restart.Height - backtomenu.Height) / 5; label1.Top = distance; continuegame.Top = label1.Top + label1.Height + distance; restart.Top = continuegame.Top + continuegame.Height + distance; backtomenu.Top = restart.Top + restart.Height + distance; }