# VBForums CodeBank > CodeBank - Visual Basic .NET >  [2005] Creating A Wizard In VB.NET

## Hack

Attached is a basic example of how to create a Wizard in VB.NET 2005.     

Thanks to Atheist for pointing out the one thing I was not sure how to do and that is work with a collection of controls (formerly known as a control array.)

I am using five GroupBox controls for the Wizard.   I chose those over Panels because I like the caption feature of the GroupBox.

This program does not actually do anything other than demonstrate how a Wizard should work.

For those of you that would like to see how this is done, but do not want to download the actual project, I put the salient portions of the code necessary in the second post of this thread.

----------


## Hack

Wizard code

```
Public Class Wizard

    Public Sub New()
        InitializeComponent()
        WizardFrameCollection = New GroupBox() {Me.GroupBox1, Me.GroupBox2, Me.GroupBox3, Me.GroupBox4, Me.GroupBox5}
    End Sub

    Private WizardFrameCollection() As GroupBox
    Private FrameIndex As Integer = 0

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            With WizardFrameCollection(0)
            .Size = New Size(533, 223)
            .Location = New Point(161, 1)
        End With        
    End Sub

    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
        WizardFrameCollection(FrameIndex).Visible = False
        FrameIndex = FrameIndex + 1
        If FrameIndex = 4 Then btnNext.Enabled = False 'last frame so there is no next
        btnBack.Enabled = True
        With WizardFrameCollection(FrameIndex)
            .Size = New Size(533, 223)
            .Location = New Point(161, 1)
            .Visible = True
        End With
    End Sub

    Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
        WizardFrameCollection(FrameIndex).Visible = False
        FrameIndex = FrameIndex - 1
        btnNext.Enabled = True
        With WizardFrameCollection(FrameIndex)
            .Size = New Size(533, 223)
            .Location = New Point(161, 1)
            .Visible = True
        End With

        If FrameIndex = 0 Then 'first frame so no where to go back to
            btnBack.Enabled = False
        Else
            btnBack.Enabled = True
        End If
    End Sub
End Class
```

----------


## Hack

Apparently, I forgot to include the solution file in my zip.

Thank you Loraine!

----------


## Loraine

I think they know how to run it even there is no solution project at all . Now the problem is after extracting the files and run it the following error showed up.




> One or more projects in the solution could not be loaded for the following reasons;
> 
> 1. The project file or web has been moved, renamed or is not on your computer.
> 
> This projects will be labeled as unavailable in solution explorer. Expand the project node to show the reason the project could not be loaded.

----------


## Hack

Is there something that I forgot to include in the zip file?

Anyone?

----------


## Loraine

Excuse me sir Hack but can you attached all the files included in the project such as:

Bin Folder(Including the files inside)
Obj Folder(Including the files inside)
My Project Folder(Including the files inside)

----------


## Hack

How is this?

----------


## Loraine

Still not working :Frown:

----------


## JuggaloBrotha

It works fine for me, although those buttons look kind of weird being white like that :P 

Loraine: Unzip all of the files to a new folder, then double click the 'Wizard.vbproj' and click 'Run' in the IDE when it's loaded

----------


## newpat

Hi Hack,
what is the wizard exactly doing?
when I select a month on yr program, the exception show out


```
 'System.ArgumentOutOfRangeException' in mscorlib.dll

other: Year、Month and Day parameter cannot represent DateTime。
```

----------

