Exemplo n.º 1
0
        //Form One Load
        private void Form1_Load(object sender, EventArgs e)
        {
            //setting gofullscreen to "true"
            GoFullscreen(true);

            //launch mainscreen
            MainScreen ms = new MainScreen();

            //add main screen
            this.Controls.Add(ms);

            // centre screen
            ms.Location = new Point((this.Width - ms.Width) / 2, (this.Height - ms.Height) / 2);
        }
Exemplo n.º 2
0
        // go back to menu screen
        private void returnbutton_Click(object sender, EventArgs e)
        {
            // f is the form that this control is on - ("this" is the current User Control)
            Form f = this.FindForm();

            f.Controls.Remove(this);

            //created instance of main screen
            MainScreen ms = new MainScreen();

            //close mainscreen
            Form x = this.FindForm();

            f.Controls.Remove(this);

            // centre screen
            ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2);

            //add menu screen
            f.Controls.Add(ms);
        }