This project has moved and is read-only. For the latest updates, please go here.

Back button and Next button

Apr 23, 2014 at 3:08 PM
Is it possible to put the "next button" to the right of the "back button", just before the Wizard icon (in the header section) ?

You can view what I am saying here :
http://vps59477.ovh.net/temp/misc/back_next_button_win7.png

It seems to be strange to have the back button at the top left of the windows and the next button at the bottom right of the windows... (For Windows 7 and 8, back and next buttons are side by side )

Otherwise, great usercontrol, thanks a lot ;)
Apr 23, 2014 at 3:42 PM
For Vista and later, the Back and Next button location for Aero Wizards is defined by the Microsoft UI Guide and the shape, size and color are controlled via the Visual Styles. If you want a wizard with different button placement, you can use the WizardPageContainer to create whatever visual experience you wish.
May 1, 2014 at 9:20 PM
I would like to keep the Aero experience so I do not need the WizardPageContainer component.
Your WizardControl is nice, I just want to put the previous and next buttons side by side (without changing anything else)

So, I tried to modify your source code to add the next button near the previous button but with no success :(

Let's explain what I want with a picture (my computer has Aero Styles enabled) :
http://vps59477.ovh.net/temp/misc/what_i_want.png

Can you help me ?

Thanks :)
May 5, 2014 at 10:05 PM
In the upcoming release (2.0.3) I will expose the controls that support glass effects along with the GlassExtenderProvider to product something similar to what you are looking for. Once released I will post some sample code on how to use those controls to accomplish the result you want.

You can accomplish it today using adding the GlassExtenderProvider to your form and then adding the following files from my project:
  • BITMAPINFO.cs
  • ControlExtension.cs
  • GDI32.cs
  • RECT.cs
  • SafeHandles.cs
  • ThemedImageButton.cs
  • ThemedTableLayoutPanel.cs
  • UXTHEME.cs
  • VisualStylesRendererExtension.cs
Below is a form that implements the buttons. This will remain the same with the updated 2.0.3 release or if you pull those files in using the 2.0.2 release or earlier.
public class Form1 : Form
{
   public Form1()
   {
      InitializeComponent();
   }

   private void wizardPageContainer1_Finished(object sender, EventArgs e)
   {
      Close();
   }

   private void wizardPageContainer1_Cancelling(object sender, CancelEventArgs e)
   {
      Close();
   }

   /// <summary>
   /// Required designer variable.
   /// </summary>
   private System.ComponentModel.IContainer components = null;

   /// <summary>
   /// Clean up any resources being used.
   /// </summary>
   /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
   protected override void Dispose(bool disposing)
   {
      if (disposing && (components != null))
      {
         components.Dispose();
      }
      base.Dispose(disposing);
   }

   #region Windows Form Designer generated code

   /// <summary>
   /// Required method for Designer support - do not modify
   /// the contents of this method with the code editor.
   /// </summary>
   private void InitializeComponent()
   {
      this.glassExtenderProvider1 = new Microsoft.Win32.DesktopWindowManager.GlassExtenderProvider();
      this.wizardPageContainer1 = new AeroWizard.WizardPageContainer();
      this.button1 = new AeroWizard.ThemedImageButton();
      this.button3 = new System.Windows.Forms.Button();
      this.wizardPage1 = new AeroWizard.WizardPage();
      this.wizardPage2 = new AeroWizard.WizardPage();
      this.themedImageButton1 = new AeroWizard.ThemedImageButton();
      this.tableLayoutPanel1 = new AeroWizard.ThemedTableLayoutPanel();
      this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
      ((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).BeginInit();
      this.wizardPageContainer1.SuspendLayout();
      this.wizardPage1.SuspendLayout();
      this.wizardPage2.SuspendLayout();
      this.tableLayoutPanel1.SuspendLayout();
      this.tableLayoutPanel2.SuspendLayout();
      this.SuspendLayout();
      // 
      // wizardPageContainer1
      // 
      this.wizardPageContainer1.BackButton = this.button1;
      this.wizardPageContainer1.BackButtonText = "<";
      this.wizardPageContainer1.CancelButton = this.button3;
      this.wizardPageContainer1.CancelButtonText = "Cancel";
      this.wizardPageContainer1.Controls.Add(this.wizardPage1);
      this.wizardPageContainer1.Controls.Add(this.wizardPage2);
      this.wizardPageContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.wizardPageContainer1.FinishButtonText = ">";
      this.wizardPageContainer1.Location = new System.Drawing.Point(0, 30);
      this.wizardPageContainer1.Name = "wizardPageContainer1";
      this.wizardPageContainer1.NextButton = this.themedImageButton1;
      this.wizardPageContainer1.NextButtonText = ">";
      this.wizardPageContainer1.Pages.Add(this.wizardPage1);
      this.wizardPageContainer1.Pages.Add(this.wizardPage2);
      this.wizardPageContainer1.Size = new System.Drawing.Size(529, 244);
      this.wizardPageContainer1.TabIndex = 0;
      this.wizardPageContainer1.Cancelling += new System.ComponentModel.CancelEventHandler(this.wizardPageContainer1_Cancelling);
      this.wizardPageContainer1.Finished += new System.EventHandler(this.wizardPageContainer1_Finished);
      // 
      // button1
      // 
      this.button1.Location = new System.Drawing.Point(0, 0);
      this.button1.Margin = new System.Windows.Forms.Padding(0);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(30, 30);
      this.button1.StyleClass = "NAVIGATION";
      this.button1.TabIndex = 0;
      this.button1.UseVisualStyleBackColor = true;
      // 
      // button3
      // 
      this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.button3.Location = new System.Drawing.Point(447, 7);
      this.button3.Margin = new System.Windows.Forms.Padding(0);
      this.button3.Name = "button3";
      this.button3.Size = new System.Drawing.Size(75, 23);
      this.button3.TabIndex = 2;
      this.button3.Text = "Cancel";
      this.button3.UseVisualStyleBackColor = true;
      // 
      // wizardPage1
      // 
      this.wizardPage1.Name = "wizardPage1";
      this.wizardPage1.Size = new System.Drawing.Size(529, 244);
      this.wizardPage1.TabIndex = 0;
      this.wizardPage1.Text = "Page Title";
      // 
      // wizardPage2
      // 
      this.wizardPage2.Name = "wizardPage2";
      this.wizardPage2.Size = new System.Drawing.Size(551, 196);
      this.wizardPage2.TabIndex = 1;
      this.wizardPage2.Text = "Page Title";
      // 
      // themedImageButton1
      // 
      this.themedImageButton1.Location = new System.Drawing.Point(30, 0);
      this.themedImageButton1.Margin = new System.Windows.Forms.Padding(0);
      this.themedImageButton1.Name = "themedImageButton1";
      this.themedImageButton1.Size = new System.Drawing.Size(30, 30);
      this.themedImageButton1.StyleClass = "NAVIGATION";
      this.themedImageButton1.StylePart = 2;
      this.themedImageButton1.TabIndex = 1;
      this.themedImageButton1.ToolTipText = "Next page";
      this.themedImageButton1.UseVisualStyleBackColor = true;
      // 
      // tableLayoutPanel1
      // 
      this.tableLayoutPanel1.BackColor = System.Drawing.Color.Black;
      this.tableLayoutPanel1.ColumnCount = 3;
      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
      this.tableLayoutPanel1.Controls.Add(this.button1, 0, 0);
      this.tableLayoutPanel1.Controls.Add(this.themedImageButton1, 1, 0);
      this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
      this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
      this.tableLayoutPanel1.Name = "tableLayoutPanel1";
      this.tableLayoutPanel1.RowCount = 1;
      this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
      this.tableLayoutPanel1.Size = new System.Drawing.Size(529, 30);
      this.tableLayoutPanel1.SupportGlass = true;
      this.tableLayoutPanel1.TabIndex = 1;
      // 
      // tableLayoutPanel2
      // 
      this.tableLayoutPanel2.AutoSize = true;
      this.tableLayoutPanel2.ColumnCount = 1;
      this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
      this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
      this.tableLayoutPanel2.Controls.Add(this.button3, 0, 0);
      this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom;
      this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 274);
      this.tableLayoutPanel2.Name = "tableLayoutPanel2";
      this.tableLayoutPanel2.Padding = new System.Windows.Forms.Padding(0, 7, 7, 7);
      this.tableLayoutPanel2.RowCount = 1;
      this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
      this.tableLayoutPanel2.Size = new System.Drawing.Size(529, 37);
      this.tableLayoutPanel2.TabIndex = 3;
      // 
      // Form1
      // 
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(529, 311);
      this.Controls.Add(this.wizardPageContainer1);
      this.Controls.Add(this.tableLayoutPanel2);
      this.Controls.Add(this.tableLayoutPanel1);
      this.glassExtenderProvider1.SetGlassMargins(this, new System.Windows.Forms.Padding(0, 30, 0, 0));
      this.Name = "Form1";
      this.Text = "Form1";
      ((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).EndInit();
      this.wizardPageContainer1.ResumeLayout(false);
      this.wizardPage1.ResumeLayout(false);
      this.wizardPage1.PerformLayout();
      this.wizardPage2.ResumeLayout(false);
      this.wizardPage2.PerformLayout();
      this.tableLayoutPanel1.ResumeLayout(false);
      this.tableLayoutPanel2.ResumeLayout(false);
      this.ResumeLayout(false);
      this.PerformLayout();
   }

   #endregion

   private Microsoft.Win32.DesktopWindowManager.GlassExtenderProvider glassExtenderProvider1;
   private AeroWizard.WizardPageContainer wizardPageContainer1;
   private AeroWizard.WizardPage wizardPage1;
   private AeroWizard.ThemedTableLayoutPanel tableLayoutPanel1;
   private AeroWizard.ThemedImageButton button1;
   private System.Windows.Forms.Button button3;
   private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
   private AeroWizard.WizardPage wizardPage2;
   private AeroWizard.ThemedImageButton themedImageButton1;
}