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.
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
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.