Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version
Go to top

A Simple Wizard Control for .Net 2.0 with Full Designer Support

, 4 Feb 2008
This is a simple yet powerful wizard framework for .Net 2.0. Just drag and drop and your component is ready for use.
wizardbase_demo.zip
WizardBase.dll
WizardDemo.exe
wizarddemo_demo.zip
WizardDemo.exe
WizardBase.dll
wizarddemo_lib.zip
WizardBase.dll
wizarddemo_src.zip
WizardDemo
WizardBase
Collection
vssver2.scc
Converters
vssver2.scc
Designers
vssver2.scc
EventArgs
vssver2.scc
Properties
vssver2.scc
Resources
back.png
icon.png
left.png
Top.png
vssver2.scc
Steps
vssver2.scc
Structures
vssver2.scc
WizardDemo
Properties
licenses.licx
Settings.settings
vssver2.scc
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using WizardBase.Properties;

namespace WizardBase
{
    [ToolboxItem(false), Designer(typeof (WizardStepDesigner)), DefaultEvent("Click")]
    public class FinishStep : WizardStep
    {
        private ColorPair pair = new ColorPair();

        public FinishStep()
        {
#pragma warning disable DoNotCallOverridableMethodsInConstructor
            Reset();
#pragma warning restore DoNotCallOverridableMethodsInConstructor
        }

        internal override void Reset()
        {
            BackColor = SystemColors.ControlLightLight;
            BindingImage = Resources.back;
            BackgroundImageLayout = ImageLayout.Tile;
        }

        ///<summary>
        ///Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
        ///</summary>
        ///
        ///<param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data. </param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            using (Brush brush = new LinearGradientBrush(ClientRectangle, pair.BackColor1, pair.BackColor2, pair.Gradient))
            {
                e.Graphics.FillRectangle(brush, ClientRectangle);
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override Image BackgroundImage
        {
            get
            {
                return base.BackgroundImage;
            }
            set
            {
                base.BackgroundImage = value;
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override Color BackColor
        {
            get
            {
                return base.BackColor;
            }
            set
            {
                base.BackColor = value;
            }
        }

        [Description("Backgroung of the finish step."), Category("Appearance")]
        public Image BindingImage
        {
            get { return base.BackgroundImage; }
            set
            {
                if (value != base.BackgroundImage)
                {
                    base.BackgroundImage = value;
                    Invalidate();
                    OnBindingImageChanged();
                }
            }
        }
        [Description("Appearence of body."), Category("Appearance")]
        public ColorPair Pair
        {
            get { return pair; }
            set
            {
                if (pair != value)
                {
                    pair = value;
                    Invalidate();
                }
            }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
        public override Color ForeColor
        {
            get { return base.ForeColor; }
            set { base.ForeColor = value; }
        }

        public bool ShouldSerializeBindingImage()
        {
            return BindingImage != Resources.back;
        }

        public void ResetBindingImage()
        {
            BindingImage = Resources.back; ;
        }

        public bool ShouldSerializePair()
        {
            return pair != new ColorPair();
        }

        public void ResetPair()
        {
            pair = new ColorPair();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Manish Ranjan Kumar
Software Developer (Senior)
India India
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 4 Feb 2008
Article Copyright 2007 by Manish Ranjan Kumar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid