Пример #1
0
        public void showSchoolsModule()
        {
            if (schoolsModule.IsDisposed)
            {
                schoolsModule           = new Schools();
                schoolsModule.MdiParent = this;
            }

            schoolsModule.Show();
            schoolsModule.Focus();
        }
Пример #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            splashScreen s = new splashScreen(this);

            s.Show();
            this.Hide();
            this.WindowState    = FormWindowState.Maximized;
            this.MinimumSize    = this.Size;
            this.IsMdiContainer = true;
            MdiClient ctlMDI;

            // for the control of type MdiClient.
            foreach (Control ctl in this.Controls)
            {
                try
                {
                    // Attempt to cast the control to type MdiClient.
                    ctlMDI = (MdiClient)ctl;

                    // Set the BackColor of the MdiClient control.
                    ctlMDI.BackColor = this.BackColor;
                }
                catch (InvalidCastException exc)
                {
                    // Catch and ignore the error if casting failed.
                }
            }

            trainingsModule = new Trainings();
            schoolsModule   = new Schools();
            playersModule   = new Players();
            paysModule      = new Pays();
            levelsModule    = new Levels();

            trainingsModule.MdiParent = this;
            schoolsModule.MdiParent   = this;
            playersModule.MdiParent   = this;
            paysModule.MdiParent      = this;
            levelsModule.MdiParent    = this;
            Connection c = new Connection();

            c.testConnection();
        }