|
-
Dec 22nd, 2000, 02:16 PM
#1
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.
-
Dec 22nd, 2000, 06:04 PM
#2
Lively Member
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!
-
Dec 23rd, 2000, 06:38 AM
#3
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.
-
Dec 23rd, 2000, 09:13 AM
#4
Many thanks, and I can write the code myself, but thank you again for offering to do it for me...
Gerco.
-
Dec 25th, 2000, 04:40 PM
#5
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.
-
Dec 26th, 2000, 06:47 AM
#6
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|