Click here to Skip to main content
12,763,226 members (28,518 online)
Click here to Skip to main content


309 bookmarked
Posted 5 Sep 2004

Designer centric Wizard control

, 15 Dec 2004 Ms-PL
A Wizard control designed for design time development.
using System;
using System.Windows.Forms.Design;
using System.ComponentModel.Design;

namespace Gui.Wizard
	/// <summary>
	/// Summary description for WizardPageDesigner.
	/// </summary>
	public class WizardPageDesigner : ParentControlDesigner
		public override DesignerVerbCollection Verbs
				DesignerVerbCollection verbs = new DesignerVerbCollection();
				verbs.Add(new DesignerVerb("Remove Page", new EventHandler(handleRemovePage)));

				return verbs;

		private void handleRemovePage(object sender, EventArgs e)
			WizardPage page = this.Control as WizardPage;

			IDesignerHost h  = (IDesignerHost) GetService(typeof(IDesignerHost));
			IComponentChangeService c = (IComponentChangeService) GetService(typeof (IComponentChangeService));

			DesignerTransaction dt = h.CreateTransaction("Remove Page");
			if (page.Parent is Wizard)
				Wizard wiz = page.Parent as Wizard;

				c.OnComponentChanging(wiz, null);
				//Drop from wizard
				c.OnComponentChanged(wiz, null, null, null);
				c.OnComponentChanging(page, null);
				//Mark for destruction
				c.OnComponentChanged(page, null, null, null);


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.


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Al Gardner
Software Developer (Senior)
United Kingdom United Kingdom
** Apologies but my daughter was born in October 2004, and so coding now comes second. My reponses tend to take a lot longer**

I've been coding since I got my first ZX Spectrum. From Basic to assembly, through C,C++ and arriving at C#. On the way I've throughly enjoyed Perl, Lisp and XML.

I find I can make the intellectual leap to understand the problem, I love big picture designs, patterns and reuse. I may be addicted to abstract classes Smile | :) GOF has a lot to answer for. I miss delete() even though I spent too much time finding the leaks.

My favourite part of coding is in UI design because of the complexity, the event driven nature, and the fact its (virtually) tactile. I hate GUI's that don't follow system guidelines, don't resize, and don't display properly when you change system colour and font.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 16 Dec 2004
Article Copyright 2004 by Al Gardner
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid