Exemple #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            List <Module> list = new List <Module>();

            //Save content of each listbox in list and pass to Base_offscreen along with selected layout
            if (nrOfModules.SelectedItem.ToString() == "1" || nrOfModules.SelectedItem.ToString() == "4")
            {
                foreach (ListBox listBox in box)
                {
                    list.Add(new Module(listBox.Items[0].ToString(), listBox.Name));
                }
                base_offscreen = new Base_offscreen(list, nrOfModules.SelectedItem.ToString());
            }
            else
            {
                foreach (ListBox listBox in box)
                {
                    list.Add(new Module(listBox.Items[0].ToString(), listBox.Name));
                }
                base_offscreen = new Base_offscreen(list, picName);
            }


            this.Hide();

            //Save last used in settings
            Properties.Settings.Default.nrOfModules = nrOfModules.SelectedIndex;
            Properties.Settings.Default.Save();

            base_offscreen.ShowDialog();
            this.Close();
        }