Beispiel #1
0
        private void pbSettings_Click(object sender, EventArgs e)
        {
            //panelProperties.Show();
            foreach (PictureBox item in this.Controls.OfType <PictureBox>())
            {
                if (item == pbForm)
                {
                    continue;
                }

                item.Hide();
            }

            if (ucSettings == null)
            {
                ucSettings = new ucSettings();
            }

            this.Controls.Add(ucSettings);
            ucSettings.SetBounds(204, -1, 595, 564);
            ucSettings.BringToFront();
            ucSettings.Show();



            ucSettings.pbBack.Click += pbBack_Click;
            ucSettings.radioButton1.CheckedChanged     += RadioButton1_CheckedChanged;
            ucSettings.radioButton2.CheckedChanged     += RadioButton2_CheckedChanged;
            ucSettings.radioButton3.CheckedChanged     += RadioButton3_CheckedChanged;
            ucSettings.tbSound.ValueChanged            += TbSound_ValueChanged;
            ucSettings.radioAppearance1.CheckedChanged += RadioArayuz1_CheckedChanged;
            ucSettings.radioAppearance2.CheckedChanged += RadioArayuz2_CheckedChanged;
            ucSettings.radioAppearance3.CheckedChanged += RadioArayuz3_CheckedChanged;
        }
Beispiel #2
0
        public void addTabPage(string page)
        {
            foreach (TabPage item in tpPage.TabPages)
            {
                if (item.Text == page)
                {
                    tpPage.SelectedTab = item; return;
                }
            }

            UserControl uc = null;

            switch (page)
            {
            case "Inventory":
                uc = new ucInventory();
                break;

            case "Sales":
                uc = new ucSales();
                break;

            case "Settings":
                uc = new ucSettings();
                break;
            }

            if (uc == null)
            {
                return;
            }

            setApplicationState(ApplicationState.Busy);
            scMain.Panel2.SuspendLayout();
            TabPage tp = new TabPage(page);

            tp.Name = page;
            uc.Dock = DockStyle.Fill;
            tp.Controls.Add(uc);
            tpPage.TabPages.Add(tp);
            tpPage.SelectedTab = tp;
            scMain.Panel2.ResumeLayout();
            setApplicationState(ApplicationState.Ready);
        }