Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Multipage for a Wizard

I have a wizard that is navigated using using buttons like, Back, Next, etc.
I want to show the tab strip so the user knows what steps are next, but I
don't want them to be able to click the tabs themselves to change the page.
I want them to have to use the buttons on the wizard.

If I disable the multipage, then everything's disabled. I thought of using
a public variable and checking if it's true or not, but I'm not sure what
events to use. Please help!

Thanks,
Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Multipage for a Wizard

You can use the .visible property to hide/show pages.

I create a small userform with a multipage control with a few pages. And a
button to advance and another button to retreat.

Option Explicit
Private Sub CommandButton1_Click()
With Me.MultiPage1
If .Value = .Pages.Count - 1 Then
Beep
Else
.Pages(.Value + 1).Visible = True
.Pages(.Value).Visible = False
End If
End With
End Sub
Private Sub CommandButton2_Click()
With Me.MultiPage1
If .Value = 0 Then
Beep
Else
.Pages(.Value - 1).Visible = True
.Pages(.Value).Visible = False
End If
End With
End Sub
Private Sub UserForm_Initialize()
Dim iCtr As Long
With Me.MultiPage1
.Value = 0 'first sheet
For iCtr = 1 To .Pages.Count - 1
.Pages(iCtr).Visible = False
Next iCtr
End With
Me.CommandButton1.Caption = "Next"
Me.CommandButton2.Caption = "Prev"
End Sub


steve wrote:

I have a wizard that is navigated using using buttons like, Back, Next, etc.
I want to show the tab strip so the user knows what steps are next, but I
don't want them to be able to click the tabs themselves to change the page.
I want them to have to use the buttons on the wizard.

If I disable the multipage, then everything's disabled. I thought of using
a public variable and checking if it's true or not, but I'm not sure what
events to use. Please help!

Thanks,
Steve


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Multipage for a Wizard

Dave,

Thanks, but that's not exactly what I'm looking for. I want all the tabs to
be visible to the user, I just don't want him to be able to change the page
by selecting a tab. I want to force him to use the Wizard controls on the
form.

thanks,
Steve

"Dave Peterson" wrote:

You can use the .visible property to hide/show pages.

I create a small userform with a multipage control with a few pages. And a
button to advance and another button to retreat.

Option Explicit
Private Sub CommandButton1_Click()
With Me.MultiPage1
If .Value = .Pages.Count - 1 Then
Beep
Else
.Pages(.Value + 1).Visible = True
.Pages(.Value).Visible = False
End If
End With
End Sub
Private Sub CommandButton2_Click()
With Me.MultiPage1
If .Value = 0 Then
Beep
Else
.Pages(.Value - 1).Visible = True
.Pages(.Value).Visible = False
End If
End With
End Sub
Private Sub UserForm_Initialize()
Dim iCtr As Long
With Me.MultiPage1
.Value = 0 'first sheet
For iCtr = 1 To .Pages.Count - 1
.Pages(iCtr).Visible = False
Next iCtr
End With
Me.CommandButton1.Caption = "Next"
Me.CommandButton2.Caption = "Prev"
End Sub


steve wrote:

I have a wizard that is navigated using using buttons like, Back, Next, etc.
I want to show the tab strip so the user knows what steps are next, but I
don't want them to be able to click the tabs themselves to change the page.
I want them to have to use the buttons on the wizard.

If I disable the multipage, then everything's disabled. I thought of using
a public variable and checking if it's true or not, but I'm not sure what
events to use. Please help!

Thanks,
Steve


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Multipage for a Wizard

Select all the code and then replace .visible with .enabled:

Option Explicit
Private Sub CommandButton1_Click()
With Me.MultiPage1
If .Value = .Pages.Count - 1 Then
Beep
Else
.Pages(.Value + 1).Enabled = True
.Pages(.Value).Enabled = False
End If
End With
End Sub
Private Sub CommandButton2_Click()
With Me.MultiPage1
If .Value = 0 Then
Beep
Else
.Pages(.Value - 1).Enabled = True
.Pages(.Value).Enabled = False
End If
End With
End Sub
Private Sub UserForm_Initialize()
Dim iCtr As Long
With Me.MultiPage1
.Value = 0 'first sheet
For iCtr = 1 To .Pages.Count - 1
.Pages(iCtr).Enabled = False
Next iCtr
End With
Me.CommandButton1.Caption = "Next"
Me.CommandButton2.Caption = "Prev"
End Sub


The tabs will be greyed out until you use the buttons to change pages.

steve wrote:

Dave,

Thanks, but that's not exactly what I'm looking for. I want all the tabs to
be visible to the user, I just don't want him to be able to change the page
by selecting a tab. I want to force him to use the Wizard controls on the
form.

thanks,
Steve

"Dave Peterson" wrote:

You can use the .visible property to hide/show pages.

I create a small userform with a multipage control with a few pages. And a
button to advance and another button to retreat.

Option Explicit
Private Sub CommandButton1_Click()
With Me.MultiPage1
If .Value = .Pages.Count - 1 Then
Beep
Else
.Pages(.Value + 1).Visible = True
.Pages(.Value).Visible = False
End If
End With
End Sub
Private Sub CommandButton2_Click()
With Me.MultiPage1
If .Value = 0 Then
Beep
Else
.Pages(.Value - 1).Visible = True
.Pages(.Value).Visible = False
End If
End With
End Sub
Private Sub UserForm_Initialize()
Dim iCtr As Long
With Me.MultiPage1
.Value = 0 'first sheet
For iCtr = 1 To .Pages.Count - 1
.Pages(iCtr).Visible = False
Next iCtr
End With
Me.CommandButton1.Caption = "Next"
Me.CommandButton2.Caption = "Prev"
End Sub


steve wrote:

I have a wizard that is navigated using using buttons like, Back, Next, etc.
I want to show the tab strip so the user knows what steps are next, but I
don't want them to be able to click the tabs themselves to change the page.
I want them to have to use the buttons on the wizard.

If I disable the multipage, then everything's disabled. I thought of using
a public variable and checking if it's true or not, but I'm not sure what
events to use. Please help!

Thanks,
Steve


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MultiPage tab? capt Excel Discussion (Misc queries) 2 January 28th 08 08:01 PM
multipage AManso Excel Programming 2 December 4th 07 03:06 PM
MultiPage tab JWM6[_5_] Excel Programming 4 April 22nd 06 02:06 AM
Allow the use of the fx wizard within the fx wizard for nesting Ron Excel Worksheet Functions 1 October 2nd 05 08:58 PM
MultiPage Michael[_25_] Excel Programming 3 January 6th 04 12:49 PM


All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"