|
dysert wrote: I'm just a beginner at this stuff
Yes I understand that. The problem comes from not knowing what you don't know
I do not know the answer to your questions off hand (I haven't actually used the control yet).
But here is what I will do. I am at work now and don't have the time to study this at the moment. What I will do is look this over tonight when I am home and see what I can do to help you out.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Your assistance is greatly appreciated. Thanks!
|
|
|
|
|
Okay I have looked at this for a bit. Maybe I can help you out a bit now. Please don't take any offense to anything that I write.
dysert wrote: intercept the NextButtonClick
dysert wrote: I tried to replicate it in my project
From this and the fact that you are "new" I have come up with a theory. I am going to go with that and leave it up to you to decide if it's right or not. Now, since you could not replicate the event handler, my thought is that you copy/pasted from the demo. Well, there are 2 parts to the event handler. There is the:
private void demoWizard_FinishButtonClick(object sender, EventArgs e)
{
MessageBox.Show("Finishing the wizard.");
Close();
}
If that is all you do, the event won't get fired because it hasn't been added yet. You also need something that looks like:
this.wizardControl1.FinishButtonClick += new System.EventHandler(this.demoWizard_FinishButtonClick);
which "wires" the event to the handler.
The easiest way to add the event handlers for this code seems to be:
Select the control in the designer,
click the Events button (looks like a lightning bolt) in the Properties window
then find the event you want to handle, for you example the event you want to handle is named "NextButtonClick"
Double click in the column next to the event and the event handler will be created for you.
The second part is, you would add the controls the same way you would add any other control. If you look at the first graphic under Step 3, you can see the there is a section named "Step navigation" under the smart tag. Navigate to the step you want to add a control to then drag and drop a control onto the designer for the step. Make sure that the control is above the next-button-control area. The panels of the wizard will contain the control and you can handle the controls directly in your form class. The wizard has a CurrentStepIndex property that will allow you to know which step you are on.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Thank you so much, Wes. Believe me, I would never take offense with anyone kind enough to help me. You're right that I didn't "wire" the event, so that explains that problem. Over the weekend I'm going to work on this, including trying to add other controls. I hope you don't mind if I post additional questions (if I have any -- given your explanations so far I may be able to carry on without any further help).
Thanks again. You've been very kind and helpful.
|
|
|
|
|
Not a problem. Glad to help.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Two more questions (for now :
1. Where do I put the "+=" wire-up code? In the demo it's in a file called Form1.Designer.cs, but I don't have a *Designer file in my project. So where do I do the wiring? (I only have a Form1.cs and a Program.cs)
2. When running the demo, the same EulaButtonClick event fires when I click the Eula button -- no matter what step I'm on. How could I respond to the EulaButtonClick in different ways depending upon which step (Start, Intermediate, Finish) I'm currently on?
Thanks!
|
|
|
|
|
dysert wrote: "+="
The designer puts that code in the Initialize componenet function. Right click on the function call and select "Go to definition" and you will be taken there. Or do a search in all files to find it.
dysert wrote: different ways depending upon which step
you would have to use the current selected index property to find out which page is being displayed to the user.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Thanks, Wes, but despite your help I think I'm in over my head. I did wire the "+=" to fire when the user clicks the Eula button, but the deeper I go the less I understand. I don't expect you to hold my hand, but in case you're curious (or in case someone is going to write up any documentation on this), here are my currently open issues:
1. How are the navigation buttons working? I searched the entire solution for NextButtonClick and found stuff, but I don't understand how it's working. Plus, if knew how to intercept the NetButtonClick event won't my code interfere with the proper operation of the control? I want to do custom stuff and afterward still advance to the next step.
2. I don't know what you're talking about when you mention the "current selected index property". There is a property called CurrentStepIndex, but it remains equal to zero regardless of what step I'm on. Maybe I'm supposed to be changing it? If so, where?
3. I'm not even sure what to do with properties and what with controls. For example, there's something called a WizardControl, which I presume is a control and has properties (like the one I mentioned in #2). There are also things called, e.g., StartStep, which I presume is also a control. I don't know, though, when I'm supposed to be concerned with the WizardControl or the StartStep (or LicenceStep, etc.).
4. I'm not clear on whether I have to add a new WizardControl to a new form for subsequent steps. I assume not -- that if I just add a new Intermediate Step then everything magically links together. But since I don't know the "magic" I don't know how and therefore don't know what I need to do in order to customize what happens when buttons at different Steps are clicked.
Since this topic is on Documentation, may I suggest that someone add a little documentation to include a few code snippets to show how to intercept a button click to do something simple like show a different MessageBox at different Steps. That would go a long way toward helping the newbies (like me) be able to effectively utilize this nice control.
Thank you.
modified on Saturday, February 9, 2008 5:54 PM
|
|
|
|
|
Yes i will definately do this. Thanks.
|
|
|
|
|
Wl currently no documentation is available. I will definately try to build one.
|
|
|
|
|
Thanks for the cool control
I would like to create few different paths in the wizard
For example: in step 2 I have a radio button with 2 options, if the user select option 1 he goes to step 3A else goes to step 3B
How can I support this with your control?
Thanks
May the source be with you
|
|
|
|
|
I added a couple of lines to the back and next handlers so as to get the wizard step control Enter and Leave events, which provide useful handlers for updating the user interface:
protected virtual void OnBackButtonClick(object sender, EventArgs e)
...
{
{
CurrentStepIndex = backStepIndex;
// Set focus thus invoking the Enter event
WizardSteps[CurrentStepIndex].Focus();
return;
...
}
CurrentStepIndex--;
// Set focus thus invoking the Enter event
WizardSteps[CurrentStepIndex].Focus();
protected virtual void OnNextButtonClick(object sender, EventArgs e)
...
CurrentStepIndex++;
// Set focus thus invoking the Enter event
WizardSteps[CurrentStepIndex].Focus();
I hope this makes sense.
David
|
|
|
|
|
I have batch built the 2 projects WizardBase and WizardDemo, and I can't find the file WizardDemo.dll. Is it supposed to be a file that is created as a reault of the build process? I see where WizardBase.dll is built, and WizardDemo.exe is built, but the project page on code project calls for WizardDemo.dll to be referenced by the target windows forms project. There is no WizardDemo.dll file. I also tried to reference both WizardDemo.exe and WizardBase.dll, in my target project, and neither of these executables created a new object in the forms toolbox. What do I really need to do to get this done?
Thanks,
Joe Farkas
|
|
|
|
|
Hi!
I have the same problem. Finally, did you used this wizard? How?
Thanks in advance
|
|
|
|
|
Hi,
First of all I would like to say that this is a very nice control with excellent designer support. But I have come accross a small bug which is that when you insert a child control onto the wizrd step and set the anchor property other than the default of top and left when you close the wizard form and open it again the size of the child control will have grown past the boundaries of the wizardstep.
Regards
Hiren
|
|
|
|
|
I have the same problem, has anyone a suggestion on how to solve/work around it?
/Patrick
|
|
|
|
|
I have the same problem!
Zoltan
|
|
|
|
|
I had the same problem:
The size of the IntermediateStep control is not stored in the generated code. Thus at runtime the scaling must fail. Maybe there's a nice solution for this, but for now I just added a size property to IntermediateStep.
public class IntermediateStep : WizardStep
{
...
[Description("Do not change manually!"), Category("Layout")]
public Size InternalSize
{
get { return base.Size; }
set { base.Size = value; }
}
...
You'll need to download the source and recompile the WizardBase.dll of course.
modified on Monday, May 26, 2008 10:04 AM
|
|
|
|
|
Hallo Stefan,
Thank you for information but I do not understand where I need to call the InternalSize property?
DE: Wo soll ich die Property benutzen?
MFG
Zoltan
|
|
|
|
|
I have the same problem, but for now I just modified the Size property in WizardStep Class.
[Browsable(false)]
public new Size Size
{
get { return base.Size; }
set { base.Size = value; }
}
liu
|
|
|
|
|
thanks a lot, very nice control,
I have a problem when i need to take the control on RightToLeft =True.
In WizardControl.cs i write this ligne but nothing is change ,the control still always in left direction,
Size = new Size(0x216, 0x193);<br />
base.Controls.Add(wizardStepsPanel);<br />
base.Controls.Add(buttonsPanel);<br />
ResumeLayout();<br />
this.RightToLeft = RightToLeft.Yes;
|
|
|
|
|
Have you considered adding a CloseStep Page that just hides all other buttons and displays only a [Close] button?
This step could be used as a point for asking the user other "unrelated questions" such as (a CheckBox field) to "Check for updates" or even displaying a [Data Import] summary.
|
|
|
|
|
You can do that with a FinishStep but you have build a sub to handle the CurrentStepIndexChanged event and hide all other buttons.
Here's an example :
Sub StepHandler(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WizardControl1.CurrentStepIndexChanged
Select Case WizardControl1.CurrentStepIndex
Case 2 ' My finish step
WizardControl1.BackButtonVisible = False
WizardControl1.NextButtonVisible = True
WizardControl1.CancelButtonVisible = False
End Select
End Sub
|
|
|
|
|
I am creating a wizard that allows the user to change single pre selected records in a dataset.
When I drag the detail dialog from the Data Source to wizard page it is not ancored to that page but appears on all pages.
A tabbed container control doesn't have this problem.
|
|
|
|
|
its such a nice effort. why don't you place it on Codeplex?
is a nice to see it there.
|
|
|
|