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"; } }