コード例 #1
0
 public void showTrainginsModule()
 {
     if (trainingsModule.IsDisposed)
     {
         trainingsModule           = new Trainings();
         trainingsModule.MdiParent = this;
     }
     trainingsModule.Show();
     trainingsModule.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();
        }