private void loadControl(BaseControlInteface control) { this.currentControl.resetControl(); this.panel1.Controls.Clear(); //System.Threading.Thread.Sleep(100); try { if (control.isLoaded() == true) control.resetData(); else control.setLoadStatus(true); this.panel1.Controls.Add(control.getThis()); this.currentControl = control; this.Text = this.currentControl.getName() + " - Company Mangement"; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void initControls() { loadForm = new Loading(); loadForm.Owner = this; Thread th1 = new Thread(new ThreadStart(initDataControls)); th1.Start(); loadForm.ShowDialog(); //loadForm.ShowDialog(); this.currentControl = EmpControl; aboutBox = new AboutControl(); }