private void AttachStep(StepDirection direction) { // Set its Wizard property currentStep.Wizard = this; // Add event handlers currentStep.StepTitleChanged += new EventHandler(OnStepTitleChanged); currentStep.StepDescriptionChanged += new EventHandler(OnStepDescriptionChanged); currentStep.NextStepChanged += new EventHandler(OnNextStepChanged); currentStep.PreviousStepChanged += new EventHandler(OnPreviousStepChanged); currentStep.PageLayoutChanged += new EventHandler(OnPageLayoutChanged); currentStep.LogoChanged += new EventHandler(OnLogoChanged); currentStep.SideBarLogoChanged += new EventHandler(OnSideBarLogoChanged); currentStep.SideBarImageChanged += new EventHandler(OnSideBarImageChanged); // Update the title OnStepTitleChanged(null, EventArgs.Empty); OnStepDescriptionChanged(null, EventArgs.Empty); // Show the step currentStep.Dock = DockStyle.Fill; panelStep.Controls.Add(currentStep); // Update the buttons OnPreviousStepChanged(null, EventArgs.Empty); OnNextStepChanged(null, EventArgs.Empty); // Update wizard layout OnPageLayoutChanged(null, EventArgs.Empty); // Update logos if neccessary OnLogoChanged(null, EventArgs.Empty); OnSideBarLogoChanged(null, EventArgs.Empty); OnSideBarImageChanged(null, EventArgs.Empty); currentStep.FireShowEvent(new ShowStepEventArgs(direction)); }