next using the Format menuitems to line-up the subway stations as shown in Figure 1 (see our previous tutorial
on the details of how to do this). Next add a single narrow image connecting all the Image 'subway stations. You
will need to use the Format | Order | Send to Back menu option to get the right look. Finally, add four labels
and make their (Name)s and Captions respectively equal to:
Lintro - Intro
Linfo - Infor
Llogo - Logon
Lgo - Go
Normally I am very casual about following naming conventions for controls - whatever is memorable and works
for you. But here we need consistency in the naming of the Image and Label controls because we are going to use
another VBA coding trick to help navigate the Subway Map. So please follow our naming conventions here.
In fact the next step is to make click on the Subway Map images and labels (8 times in all) and add the following
one line of code each time:
for Imintro_Click() and Lintro_Click() add => Tabs.Value = 0
for Iminfo_Click() and Linfo_Click() add => Tabs.Value = 1
for Imlogo_Click() and Llogo_Click() add => Tabs.Value = 2
for Imintro_Click() and Lintro_Click() add => Tabs.Value = 3
What these eight subroutines do is activate the correct tab on the Multipage control depending on what "subway
stop" has been collected. but just as we did in the case of the Command Buttons we have to make sure the converse
is true - if the Info tab of the Multipage is activated (perhaps using the Next button); then the Subway map is
updated as well. we
Public Sub setSubwayMap()
REM First restore the labels to default color and size
Controls("L" & curStep).ForeColor = vbWhite
Controls("L" & curStep).Font.Size = 11
REM - depending on Tab value set curStep- current step
Select Case Tabs.Value
curStep = "intro"
curStep = "info"
curStep = "logon"
curStep = "go"
REM - Now with new value of curStep highlight active Subway Stop
REM - by making its label bigger and yellow in color
Controls("L" & curStep).ForeColor = vbYellow
Controls("L" & curStep).Font.Size = 12
Note to make this all work we must add the following line to the top of our code - Dim curStep as String
and then the following line of code - call setSubwayMap - to the top of the Sub Tabs_Change()
procedure. Finally we shall coverup the Multipage Tabs and use the complete area of the Tab for our various
Wizard steps/pages. To do so highlight the Mutipage Tabs and set its Style property to 2-fmTabStyleNone. Then set
the Picture property of the Intro Page to Start.bmp. which is just a white rectangle created in Microsoft Paint
equal in size to the MultiPage control (just use the Height and Width properties of the Multipage when creating
Start.bmp in Paint using Image | Attribute menuitem.). One final setting will ensure that the picture fits exactly
over the surface of the Intro page - set the PictureSizeMode property to 1-fmPictureSizeModeStretch. And voila
- our Wizard is half-baked!