public MainForm() { InitializeComponent(); //custom color var materialSkinManager = MaterialSkinManager.Instance; materialSkinManager.AddFormToManage(this); materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; materialSkinManager.ColorScheme = new ColorScheme(Primary.Blue400, Primary.Blue600, Primary.Blue600, Accent.LightBlue200, TextShade.WHITE); //Instantiation du formulaire enfant import = new ImportForm(); //Définition en formulaire inclus import.TopLevel = false; //Agrandissement à la taille du panel conteneur import.Dock = DockStyle.Fill; //Ajout du formulaire au panel principal plContent.Controls.Add(import); //Idem pour les autres formulaires data = new DataForm(); data.TopLevel = false; data.Dock = DockStyle.Fill; plContent.Controls.Add(data); //Idem pour les autres formulaires synthesis = new SyntheseForm(); synthesis.TopLevel = false; synthesis.Dock = DockStyle.Fill; plContent.Controls.Add(synthesis); //Idem pour les autres formulaires export = new ExportForm(); export.TopLevel = false; export.Dock = DockStyle.Fill; plContent.Controls.Add(export); //Idem pour les autres formulaires configuration = new ConfigurationForm(); configuration.TopLevel = false; configuration.Dock = DockStyle.Fill; plContent.Controls.Add(configuration); //Idem pour les autres formulaires sensorForm = new SensorForm(); sensorForm.TopLevel = false; sensorForm.Dock = DockStyle.Fill; plContent.Controls.Add(sensorForm); try { Dictionary <String, String> parameters = new Dictionary <String, String>(); List <Dictionary <String, String> > lines = Database.select("SELECT id,label FROM sensor", parameters); cbSensor.DisplayMember = "Text"; cbSensor.ValueMember = "Name"; cbSensor.Items.Add(new MenuItem() { Text = "", Name = "" }); foreach (Dictionary <String, String> line in lines) { MenuItem item = new MenuItem(); item.Text = line["label"]; item.Name = line["id"]; cbSensor.Items.Add(item); } synthesis.Show(); synthesis.refreshSynthese(); dtStart.Value = new DateTime(DateTime.Now.Year, 1, 1); dtEnd.Value = DateTime.Now.AddDays(1); } catch (Exception ex) { MessageBox.Show(ex.Message); configuration.Show(); configuration.refreshConfig(); } }
private void btnConfiguration_Click(object sender, EventArgs e) { hideForms(); configuration.Show(); configuration.refreshConfig(); }