Results 1 to 6 of 6

Thread: Wizard: How do you create one?

  1. #1
    Guest

    Question

    Does anyone know how to build a wizard?

    The idea is to have a program:
    1. compress a database to .zip format using an very cool ActiveX control I found.
    2. To format a diskette (of have the user format it himself)
    3. To copy the compressed file to the diskette.

    I'd like to make a wizard that does this (including fancy "Next" and "Previous" buttons).

    How do I do this? When I make a form with a huge label to display information and a next button, I run into trouble writing the code for the button. How do I separate the various stages of the wizard from each other?

    I'd like to have a clean sheet of code for each screen of the wizard.

    Thanks,
    Gerco.

  2. #2
    Lively Member
    Join Date
    Oct 1999
    Location
    East Ballina,NSW,Australia
    Posts
    121

    Cool this will help

    hi,

    If you visit http://www.active-x.com/ , click on search and type in "wizard" it will come up with about 15 different active x controls that will help you create a really "cool" wizard for your app.
    simply download the active x control register it and add it to your app.
    Easy!

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    You can even write your own code for a wizard.

    What you need is a form, command buttons to provide for the Back and Next functionality, and a control array of frames.

    Arrenge the frames on top of each other, make them all the same height and width, align their left and top coordinates, and make them all invisible by setting their properties in design mode.

    The number of frames in the array depends upon how many screens you need to show to the user for completing the wizard. On each fram provide the necessary controls for completing each step of the wizard.

    Use a variable to track the currently visible frame. Set it to 0 at form load.

    In the Next button, write code which first hides the current frame, then increments the counter by one and displays the 'counter'th frame.

    In the Back button, reverse the functionality of the Next button, hide the current frame, decrement the counter and show the previous frame.

    And then provide other validations as you require them.

    If you are as lazy as I am or can't write the code from what I have written above, write back and I shall do it for you.

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4
    Guest
    Many thanks, and I can write the code myself, but thank you again for offering to do it for me...

    Gerco.

  5. #5
    Guest
    Another thing you can do is use:
    Button - "Next >"
    Button - "< Previous"
    Button - "Exit"
    SSTab control

    The Tab control is very good, you can create as many tabs as you like, and you can manage the controls on each tab separately, so you won't have to mess with frames and make sure they are aligned and stuff like that.
    There is an option to hide the tabs so it won't look like the tab control is there.
    In the "Next" button just increment the index of the current tab, in the "Previous" button, decrement it.
    That's what I do when I create a wizard.

    Hope this helps.

  6. #6
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Oh, hell.

    Here it goes...


    Code:
    'On your form, create a control array of 5 frames.
    'You can create more, but let's just take five.
    
    'Align all frames so they are on top of each other.
    'Set their Visible property to False
    
    'Place three Command Buttons on the bottom of the form,
    'outside the frames.
    
    'Name the first one as cmdClose, put the caption Close
    'Name the second one as cmdNext, put the caption Next
    'Name the third one as cmdBack, put the caption Back
    'Arrenge them properly on the form.
    
    Dim intCurFrame As Integer
    
    Private Sub Form_Load()
    intCurFrame = 0
    End Sub
    
    Private Sub Form_Activate()
    Frame1(intCurFrame).Visible = True
    End Sub
    
    Private Sub cmdClose_Click()
    Unload Me
    End Sub
    
    Private Sub cmdNext_Click()
    Frame1(intCurFrame).Visible = False
    intCurFrame = intCurFrame + 1
    cmdBack.Enabled = True
    If intCurFrame = Frame1.UBound Then
      cmdNext.Enabled = False
    End If
    Frame1(intCurFrame).Visible = True
    End Sub
    
    Private Sub cmdBack_Click()
    Frame1(intCurFrame).Visible = False
    intCurFrame = intCurFrame - 1
    cmdNext.Enabled = True
    If intCurFrame = Frame1.LBound Then
       cmdBack.Enabled = False
    End If
    Frame1(intCurFrame).Visible = True
    End Sub
    This is a basic code which will hopefully take you through all the frames. Remove the enabled/disabled logic for now, if you find it troublesome. You can put all validations later.

    Put controls onto each form, and your wizard is ready.


    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

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



Click Here to Expand Forum to Full Width