|
This is interesting. But its all VERY unnecessary. If you want to create a wizard. Just inherit a new control from the tabcontrol and either use createparams to keep the tabs from being drawn or modify the controls region to match its first tab page. Then style the wizard from as you like. Use tab pages for each page of the wizard. you can even have the tabs show up in the designer to make it easier to set up. Add some buttons at the bottom to control the current displayed tabpage and boom. Simple 5 minute wizard, no fuss, no trouble. no dll, and no license.
Here is an example of hiding tabs
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace customControls
{
public class TabControlEx : TabControl
{
[
Description("Gets or sets a value indicating whether the tab headers should be drawn"),
DefaultValue(true)
]
public bool ShowTabHeaders { get; set; }
public TabControlEx()
: base()
{
}
protected override void WndProc(ref Message m)
{
if (!ShowTabHeaders && m.Msg == 0x1328 && !DesignMode)
m.Result = (IntPtr)1;
else
base.WndProc(ref m);
}
}
}
|
|
|
|
|
thanks master
|
|
|
|
|
Did anybody eventually figure out how to control Next/Back/Cancel/Finish butons.
The demo just calls Close(), but in reality how to you get the next page when you click on Next? How it supposed to be wired into WizardControl? I tried to call myWizCtl.OnNextButtonClick from the form handler, but it wont even compile since the latter is a protected member...any other way?
|
|
|
|
|
bugs in generated code.
no support whatsoever.
runtime appearance different from design time appearance.
article sucks - no explanation of anything.
|
|
|
|
|
Has anyone applied all the fixes & enhancments mentioned and have a working .dll? If so, it'd be super if they'd share the source with the rest of the CodeProject community I'm fairly new to C#, and this code is a wee bit over my head.
|
|
|
|
|
Hi!
I'm new to wizards and also almost new to MDI application...
I'm trying to build an MDI application with wizard to use with database for configuring some special properties of tables.
Before starting I want to thank you for your this great control and then I'd like to know if this is the last version you release or if I can find somewhere a newer one.
If I'm not wrong the control version downloaded here is 1.0.1.0.
Thanks!
modified on Tuesday, October 20, 2009 5:09 AM
|
|
|
|
|
Hello,
I have three intermediate steps in my wizard control. I want to control the navigation from step2 to step3 by a custom criteria. That means if user doesn't satisfy step requirements, an error message is shown and he remains in the same step.
Thanks
Best regards
Amin Zargar
|
|
|
|
|
I think you can use
wizardControl1.CurrentStepIndex++;
to simulate the clicking next button event.
And use
wizardControl1.CurrentStepIndex = 3;
to go to the 3rd page in any step.
|
|
|
|
|
Amazing and yet simple control, excelent programming
|
|
|
|
|
This Add-In is awesome, thanks.
I was having a bit of trouble loading my license file so I added a catch block as below:
[Editor(typeof(CustomFileNameEditor), typeof(UITypeEditor))]
[Description("License file to display."), Category("Behavior")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string LicenseFile
{
get { return licenseFile; }
set
{
if (licenseFile != value)
{
if(string.IsNullOrEmpty(value))
{
rtbLicense.Text = "Please select the licence file.";
licenseFile = value;
}
else
{
try
{
rtbLicense.LoadFile(value);
licenseFile = value;
}
catch(Exception ex)
{
rtbLicense.Text = "Error: You do not have a license to use this software: " +
ex.Message;
licenseFile = null;
}
}
}
}
}
|
|
|
|
|
We've used your simple wizard control to create an installer for our product. We like it very much! Unfortunately, our intellectual property attorneys can't accept the Code Project Open License. I'm terribly sorry that we didn't consult with the IP attorneys before we implemented, but we didn't.
I'm not an intellectual property attorney and I'm not qualified to dispute their dislike of the CPOL license.
I'm trying to find a way to let us redistribute WizardBase.dll under a license which is acceptable to our IP attorney. Would you consider changing to a BSD license for this code, either at the project level, or as a special "one off" so I could use your code in a commercial product?
Thanks,
Mark Waite
MarkWaite at yahoo dot com
|
|
|
|
|
Geeze, the CPOL is about as un-restrictive as you can get. What specifically does your IP attorney have a problem with? You may also want to bring this up with Chris in the Suggestions/Site Bugs forum.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I've learned not to argue with attorneys, especially when I'm trying to move other things very quickly. I'm not an attorney, and I am new to the company because the previous company was purchased by the new company.
The attorney specifically objected to the phrases which I marked in bold text:
You may distribute the Executable Files and Source Code only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy of the Executable Files or Source Code You distribute and ensure that anyone receiving such Executable Files and Source Code agrees that the terms of this License apply to such Executable Files and/or Source Code. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute the Executable Files or Source Code with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License
Apparently those restrictions apply to the executable as well as the source, where they are more typically applied only to the source code in other open source licenses and that was the "sticking point" for the attorney. I don't claim to understand the legal conditions and terms of the various licenses. The CodeProject license comparison page makes it seem like the CPOL is a better license, yet the attorney preferred the BSD license above it.
There is an interesting posting from 2006 by Jon Galloway which concludes that the CPOL license is more restrictive than most open source licenses. It may be that is an earlier version than CPOL 1.02. I'm not sure.
I am sure that I need the attorneys on my side if I want to release software, and I want to release software...
I'll consider bringing the discussion to the Site Bugs forum.
Thanks
Mark Waite
|
|
|
|
|
I'm using VS2008/.Net 3.5:
I didn't like the way the binding image was stretched to fill the graphic panel, so I made the following modifications:
In StartStep.cs , replace the original OnPaint() method with the code below:
protected override void OnPaint(PaintEventArgs e)
{
Rectangle rect;
Rectangle iconRect;
RectangleF titleRect;
RectangleF subtitleRect;
base.OnPaint(e);
Graphics graphics = e.Graphics;
rect = LeftRectangle;
GetTextBounds(out titleRect, out subtitleRect);
Rectangle gradientRect = new Rectangle(rect.Location, rect.Size);
Rectangle bindingRect = new Rectangle(0, 0, 0, 0);
if (bindingImage != null)
{
bindingRect.Size = new Size(bindingImage.Size.Width, bindingImage.Size.Height);
if (bindingRect.Width != rect.Width)
{
float pct = (float)rect.Width / (float)bindingRect.Width;
bindingRect.Size = new Size(rect.Width, (int)(bindingRect.Height * pct));
}
gradientRect.Location = new Point(gradientRect.X, gradientRect.Y + bindingRect.Height - 1);
gradientRect.Size = new Size(gradientRect.Width, gradientRect.Height - bindingRect.Height);
}
using (Brush brush = new LinearGradientBrush(gradientRect, leftPair.BackColor1, leftPair.BackColor2, leftPair.Gradient))
{
graphics.FillRectangle(brush, gradientRect);
}
if (bindingImage != null)
{
graphics.DrawImage(bindingImage, bindingRect);
}
if (iconImage != null)
{
iconRect = IconRectangle;
iconRect.Inflate(-1, -1);
graphics.DrawImage(iconImage, iconRect);
}
DrawText(graphics, titleRect, title, titleAppearence);
DrawText(graphics, subtitleRect, subtitle, subtitleAppearence);
}
In IntermediateStep.cs , LicenseStep.cs , and FinalStep.cs , replace the original OnPaint() with this one:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics graphics = e.Graphics;
Rectangle rect = HeaderRectangle;
Rectangle rectangle;
RectangleF titleRect;
RectangleF subtitleRect;
Rectangle gradientRect = new Rectangle(rect.Location, rect.Size);
Rectangle bindingRect = new Rectangle(0, 0, 0, 0);
GetTextBounds(out titleRect, out subtitleRect);
if (bindingImage != null)
{
bindingRect.Size = new Size(bindingImage.Size.Width, bindingImage.Size.Height);
if (bindingRect.Height != rect.Height)
{
float pct = (float)rect.Height / (float)bindingRect.Height;
bindingRect.Size = new Size((int)((float)bindingRect.Width * pct), rect.Height);
bindingRect.Location = new Point(gradientRect.Width - bindingRect.Width, 0);
}
gradientRect.Location = new Point(gradientRect.X, gradientRect.Y);
gradientRect.Size = new Size(gradientRect.Width - bindingRect.Width, gradientRect.Height);
}
headerPair = new ColorPair(Color.White, Color.DarkSlateBlue, 180);
using (Brush brush = new LinearGradientBrush(gradientRect, headerPair.BackColor1, headerPair.BackColor2, headerPair.Gradient))
{
graphics.FillRectangle(brush, gradientRect);
}
if (bindingImage != null)
{
graphics.DrawImage(bindingImage, bindingRect);
}
titleAppearence.TextShadowColor = Color.Transparent;
titleAppearence.TextColor = Color.White;
subtitleAppearence.TextColor = Color.White;
subtitleAppearence.TextShadowColor = Color.Transparent;
DrawText(graphics, titleRect, title, titleAppearence);
DrawText(graphics, subtitleRect, subtitle, subtitleAppearence);
}
The code above resizes the bindingImage to fit inside the graphic panel, while maintaining the original aspect ratio of the image. It further changes the gradient rectangle so that it ends where the bindingImage starts, thus providing a reasonable transition from the gradient to the image. Of course, this only really looks good if the bindingImage has a single-color background, but you can also just set the gradient colors to be the same (essentially eliminating the gradient).
Other things I had to do:
0) I had to comment out all the pragma s because I kept getting compile errors.
1) I had to comment out the set functionality in the LeftPair property because I kept getting the serialization n compiler error.
2) I had to hard-code my gradient colors because the designer refused to keep the settings I made.
3) When I tried to set the bindingImage for the intermediate step page, I was getting an error from the IDE saying the setting already existed. All I did was click on it - I never got to the point where I could change the setting.
4) When I try to add a handler for normal form events, the method templates aren't being added to the application - anywhere.
IMHO, this could would be better if there were templates created to create the form and it's child pages. I think that would simplify the code and enable us to better isolate deficiencies.
I also think you would have been better served to create a StepBase class and put all the common stuff in it, such as the graphic panel, the binding image, and the gradient color pair stuff, just to name a few of the items.
Personal note to the author:
You seemed to have put a lot of work into the code, but you stopped far short of coming up with something viable. There is absolutely no reason for me to have to hard-code stuff into the control itself to make changes, especially with the effort you put into making the control compatible with the IDE designer. Further, you seem to have abandoned the code, forcing your users to try to figure out what the hell your code does. There is no documentation, and pitifully few comments, thus making the code a royal bitch to maintain. It now falls on someone else to take your c ode and recreate it in their own image, and hopefully post a new article with code that actually works.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
if you want to provide a grafical design then provide it as a template, as I am finding it a pain to remove the default gradient etc...
if you be nice to start with a blank slate
|
|
|
|
|
I ended up hard coding the gradient I wanted. The code in this article is only half done.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I was just saying it would be nice to have a blank canvas to start from and not have to remove someone else's design first, if the author wants to include some designs then it should be included as a template that can be selected on the properties window
|
|
|
|
|
The author has abandoned the article. You'll get no satisfaction from him. I stand by my claim that the code is only half done.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
you are right, it is very buggy and awkward to use at times.
but I have not been able find a free replacement that will work under 3.5 as of yet
|
|
|
|
|
Well, I've started a complete rewrite. It's gonna take a while because I've never done a designer-integrated control before. IMHO, that's where most of the problems lie in the existing code, so designer integration may have to wait or even be abandoned because backward compatibility will be an issue, not to mention forward compatibility.
I'm leaning toward the control-as-a-template idea, and am designing the base classes that provide the basic/common functionality. When the programmer creates a control from the template, he'll be able to make normal changes n the designer, but special settings may be restricted to being manually added - I simply don't know yet.
Anyway, I'll post an article when it's ready.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Help why do I get this error??????
"No overload for 'wizardControl1_NextButtonClick' matches delegate 'WizardBase.GenericCancelEventHandler<WizardBase.WizardControl>"
on this line of code
<code>this.wizardControl1.NextButtonClick += new WizardBase.GenericCancelEventHandler<WizardBase.WizardControl>(this.wizardControl1_NextButtonClick);</code>
|
|
|
|
|
I HAVE THA SAME ERROR. Can some one help?
|
|
|
|
|
help me please... same error occurs..
|
|
|
|
|
reply reference.(2page)
thanks!
================================================================
Re: NextButtonClick Event [modified] MadStudent 7:21 29 Feb '08
================================================================
|
|
|
|
|
No answer to this question until now? I have the same error. Please help.
|
|
|
|
|