Sebbo
Sebbo

Reputation: 405

Creating a wizard

So I am trying to create a form in Visual Studio C# 2010 Express that is going to act as a sequential form. I am not sure if I am using the correct term for this type of form and I have not found any tutorials online for this either.

Basically, I have a form that is going to ask the user for data one step at a time. It's going to display a couple of inputs on the initial form. There is a NEXT button in the bottom that will guide users to the next set of inputs if all info is filled out on the initial form.

I know how to create a popup form, but I want a new set of inputs to be displayed within the main form when the user presses NEXT. There should also be a BACK button. Kind of like a step-by-step installation procedure one would see when installing IBM's RAD, for example.

I dont have any actual code yet, I am just trying to find a tutorial that is going to simulate this type of form so I can learn how to do it best.

Upvotes: 3

Views: 19843

Answers (2)

nawfal
nawfal

Reputation: 73163

I never understood what is the big deal in creating wizard looking form.

Some simple steps:

  1. Have just one form.

  2. Create two panels, one for holding your previous and next buttons, and the other for containing specific controls.

  3. Have many such latter panels for each view. Fill each panel with the controls you would want it to have.

  4. Create an enum which has as many values like WelcomeScreen, FillUpPage, ByeBye etc

  5. Create one large function which accepts the enum as the parameter.

Like this:

GoToMode(FormMode mode)
{ 
     if (mode == something)
        GoToThatMode();
     //etc
}
  1. Have a Reset function which disables all control

    GoToMode(FormMode mode)
    { 
        ResetFunction(); //which disables or hides all panels
    
        if (mode == something)
            GoToThatMode();
        //etc
    }
    
  2. Enable the required panel in each GoToThatMode function.

Things dont get simpler.

Upvotes: 3

Magnus Johansson
Magnus Johansson

Reputation: 28325

What you are looking for is mostly known as a Wizard that will guide the user through a predefined number of steps.

Here are some examples to get you going:
Simple Wizard for WinForms
C# Windows Aero Style Wizard Control

Upvotes: 4

Related Questions