Ejemplo n.º 1
0
        public Form_wizard()
        {   
            InitializeComponent();
            this.Text = Translation.GetText("W_caption");
            btn_back.Text = Translation.Btn_back;
            btn_next.Text = Translation.Btn_next;
            btn_cancel.Text = Translation.Btn_cancel;
            W_page.Translate();
            typeof(GroupBox).InvokeMember("DoubleBuffered", BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, groupBox_MainPanel, new object[] { true });

            uc_welcome = new UC_W_welcome();
            uc_classicCurve = new UC_W_classicCurve();
            uc_doubleBtn = new UC_W_doubleBtn();
            uc_wheelBtn = new UC_W_wheelBtn();
            uc_final = new UC_W_activation();

            groupBox_MainPanel.Controls.Add(uc_welcome);
            groupBox_MainPanel.Controls.Add(uc_classicCurve);
            groupBox_MainPanel.Controls.Add(uc_doubleBtn);
            groupBox_MainPanel.Controls.Add(uc_wheelBtn);
            groupBox_MainPanel.Controls.Add(uc_final);

            foreach (BaseWizardControl control in groupBox_MainPanel.Controls)
            {
                control.Dock = DockStyle.Fill;
                control.Visible = false;
                control.ChangeCaption += new BaseWizardControl.DlgChangeCaption(ChangeCaption);
                control.ChangeInfoText += new BaseWizardControl.DlgChangeInfoText(uC_infoIcon1.ChangeInfoText);
                control.ShowBalloonTip += new BaseWizardControl.DlgShowBalloonTip(ShowBallonTip);
            }
            m_currentControl = uc_welcome;
            MoveToPage(m_currentControl.Identifier);           
        }        
Ejemplo n.º 2
0
        private void MoveToPage(BaseWizardControl.Page page)
        {
            m_currentControl.Hide();
            btn_back.Enabled = true;
            switch (page)
            {
                case BaseWizardControl.Page.Welcome:
                    m_currentControl = uc_welcome;
                    break;
                case BaseWizardControl.Page.ClassicCurve:
                    m_currentControl = uc_classicCurve;
                    break;
                case BaseWizardControl.Page.DoubleBtn:
                    m_currentControl = uc_doubleBtn;
                    break;
                case BaseWizardControl.Page.WheelBtn:
                    m_currentControl = uc_wheelBtn;
                    break;
                case BaseWizardControl.Page.Activation:
                    m_currentControl = uc_final;
                    break;               
            }
            m_currentControl.Show();


            if (m_currentControl.Next != BaseWizardControl.Page.None)
            {
                btn_next.DialogResult = DialogResult.None;
                btn_next.Text = Translation.Btn_next;
            }
            else
            {
                btn_next.DialogResult = DialogResult.OK;
                btn_next.Text = Translation.Btn_finish;
            }
            if (m_currentControl.Previous == BaseWizardControl.Page.None)
            {
                btn_back.Enabled = false;
            }
        }