[2005] Creating A Wizard In VB.NET-VBForums
Results 1 to 10 of 10

Thread: [2005] Creating A Wizard In VB.NET

  1. #1

    Thread Starter
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    [2005] Creating A Wizard In VB.NET

    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.
    Attached Files Attached Files
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  2. #2

    Thread Starter
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: [2005] Creating A Wizard In VB.NET

    Wizard code
    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
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: [2005] Creating A Wizard In VB.NET

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

    Thank you Loraine!
    Attached Files Attached Files
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  4. #4
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: [2005] Creating A Wizard In VB.NET

    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.

  5. #5

    Thread Starter
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: [2005] Creating A Wizard In VB.NET

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

    Anyone?
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  6. #6
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: [2005] Creating A Wizard In VB.NET

    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)

  7. #7

    Thread Starter
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: [2005] Creating A Wizard In VB.NET

    How is this?
    Attached Files Attached Files
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  8. #8
    Fanatic Member Loraine's Avatar
    Join Date
    Aug 2006
    Location
    8ft. underground
    Posts
    581

    Re: [2005] Creating A Wizard In VB.NET

    Still not working

  9. #9
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    3,811

    Re: [2005] Creating A Wizard In VB.NET

    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

  10. #10
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Hong Kong
    Posts
    384

    Re: [2005] Creating A Wizard In VB.NET

    Hi Hack,
    what is the wizard exactly doing?
    when I select a month on yr program, the exception show out
    Code:
     'System.ArgumentOutOfRangeException' in mscorlib.dll
    
    other: Year、Month and Day parameter cannot represent DateTime。

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.