Exemple #1
0
        private void FormPlaneSelect_Load(object sender, EventArgs e)
        {
            dh        = new DataHandlerDGV();
            formplane = this;
            SqlConnection  Conn   = new SqlConnection(Path);
            SqlDataAdapter reader = new SqlDataAdapter(Q, Conn);



            reader.Fill(table);
            dgvSelectPlane.DataSource = table;
            Conn.Close();

            btnStart.Enabled = false;
            MessageBox.Show("Select plane from datagrid to enable start simulation button");
        }
 //constructor
 public FormMainMenu()
 {
     form1 = this;
     form2 = new FormPlaneSelect();
     InitializeComponent();
     leftBorderBtn             = new Panel();
     leftBorderBtnSubMenu      = new Panel();
     leftBorderBtn.Size        = new Size(7, 60);
     leftBorderBtnSubMenu.Size = new Size(7, 60);
     pnlMenu.Controls.Add(leftBorderBtn);
     pnlAircraftSubMenu.Controls.Add(leftBorderBtnSubMenu);
     HideSubMenu();                       //activate method for submenu
     //form
     this.Text            = string.Empty; //the next three lines is to stop buffering when dragging form and get rid of form name ontop
     this.ControlBox      = false;
     this.DoubleBuffered  = true;
     this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea; //to allow desktop toolbar to show on bottom when maximized app
     //time and date labels update
     thread1 = new Thread(new ThreadStart(Timer));                      //thread for time and date label
     thread1.Start();                                                   //starting thread for time label
 }