コード例 #1
0
 /// <summary>
 /// Starts the wizard.
 /// </summary>
 /// <param name="windowName">Text that appears in the title bar of the wizard window.</param>
 /// <param name="icon">Sets the Icon of the wizard window</param>
 /// <param name="showInTaskBar">Sets the ShowInTaskbar property of the wizard window</param>
 /// <returns>Whether the wizard was aborted, failed, or ran to completion.</returns>
 public WizardResult StartWizard(string windowName, bool showInTaskBar, Icon icon)
 {
     if (steps == null || steps.Count < 1)
     {
         throw new EmptyStepSequenceException();
     }
     if (steps[steps.Count - 1] is ConditionalStep)
     {
         throw new ConditionalStepAtEndException();
     }
     wizardForm                = new WizardForm(windowName);
     wizardForm.LogoImage      = this.LogoImage;
     wizardForm.btnNext.Click += new EventHandler(btnNext_Click);
     wizardForm.btnBack.Click += new EventHandler(btnPrevious_Click);
     wizardForm.ShowInTaskbar  = showInTaskBar;
     if (icon != null)
     {
         wizardForm.Icon = icon;
     }
     wizardForm.Enabled = true;
     wizardForm.BringToFront();
     currentStepIndex = 0;
     runComponent(steps[currentStepIndex]);
     wizardForm.ShowDialog();
     return(result);
 }
コード例 #2
0
 public WizardResult StartWizard(string windowName, bool showInTaskBar, Icon icon, int width, int height)  //DC added width and height    
 {
     if (steps == null || steps.Count < 1)            
         throw new EmptyStepSequenceException();
     
     if (steps[steps.Count - 1] is ConditionalStep)            
         throw new ConditionalStepAtEndException();
     
     wizardForm = new WizardForm(windowName);
         
     if (width > -1)                                         //DC
         wizardForm.Width = width;    //DC
     if (height > -1)                                        //DC    
         wizardForm.Height = height;  //DC
     wizardForm.LogoImage = this.LogoImage;
     wizardForm.btnNext.Click += new EventHandler(btnNext_Click);
     wizardForm.btnBack.Click += new EventHandler(btnPrevious_Click);
     wizardForm.ShowInTaskbar = showInTaskBar;
     if (icon != null) wizardForm.Icon = icon;
     wizardForm.Enabled = true;
     wizardForm.BringToFront();
     currentStepIndex = 0;
     runComponent(steps[currentStepIndex]);
     wizardForm.ShowDialog();
     return result;
 }