Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Multipage Pages will not show controls when enabled

I have a UserForm with a Combobox named "cboIllumination" and a MultiPage
name "mpgIllumination". When the UserForm is Intialized all the pages in the
mpgIllumination.Enabled = False and cboIllumination.ListIndex = 0.
Here is the problem. As the user changes cboIllumation I want the
associated page in mpgIllumination to be enabled and display the controls in
it. The code below will enable the page, but the controls are not visible
until I select it, why? Is it possible to make sure the controls are visible
when the pages enable property = True.

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex < 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

End Sub
--
Cheers,
Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Multipage Pages will not show controls when enabled

I created a small userform with a combobox on it with 3 entries. I added a
multipage with 3 pages.

I wanted the first item in the combobox to control page0, the 2nd item to
control page1 and the 3rd item to control page2. That seems different from what
you used. (You checked for < 0. 0 represents the first item in the combobox
list.) Did you mean that???

Anyway....

Your code worked ok for me.

Maybe adding
Me.Repaint
to the end of that procedure will make it work ok for you. (I didn't need it,
though.)

Private Sub cboIllumination_Change()
Dim pg As Page
'disables all three pages
For Each pg In Me.mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If Me.cboIllumination.ListIndex < 0 Then
'do nothing
Else
With Me.mpgIllumination.Pages(Me.cboIllumination.ListIn dex)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub

Another method:

Private Sub cboIllumination_Change()
Dim iCtr As Long
If Me.cboIllumination.Value < 0 Then
Exit Sub
Else
With Me.mpgIllumination
For iCtr = 0 To .Count - 1
.Pages(iCtr).Visible = True 'CBool(iCtr =
Me.cboIllumination.ListIndex)
.Pages(iCtr).Enabled = CBool(iCtr =
Me.cboIllumination.ListIndex)
Next iCtr
End With
End If
End Sub

RyanH wrote:

I have a UserForm with a Combobox named "cboIllumination" and a MultiPage
name "mpgIllumination". When the UserForm is Intialized all the pages in the
mpgIllumination.Enabled = False and cboIllumination.ListIndex = 0.
Here is the problem. As the user changes cboIllumation I want the
associated page in mpgIllumination to be enabled and display the controls in
it. The code below will enable the page, but the controls are not visible
until I select it, why? Is it possible to make sure the controls are visible
when the pages enable property = True.

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex < 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

End Sub
--
Cheers,
Ryan


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Multipage Pages will not show controls when enabled

Yes I did mean to do that. These are the items in cboIllumination when the
Userform is Initialized. I have set the enable property for each page of the
mpgIllumination = False. So when "Single Row T12 HO Fluorescents" is
selected Page(0) should be enabled and the controls on that page should be
visible, but they are not. The Page enables, but the controls are not
visible until I click the Page Tab, then they appear. Then Me.Repaint did
not seem to work. Any other ideas or suggestions?

UserForm_Initialize()

With cboIllumination
.AddItem "No Illumination"
.AddItem "Single Row T12 HO Fluorescents"
.AddItem "Single Row T8 HO Fluorescents"
.AddItem "LEDs"
End With

End Sub

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub
--
Cheers,
Ryan


"Dave Peterson" wrote:

I created a small userform with a combobox on it with 3 entries. I added a
multipage with 3 pages.

I wanted the first item in the combobox to control page0, the 2nd item to
control page1 and the 3rd item to control page2. That seems different from what
you used. (You checked for < 0. 0 represents the first item in the combobox
list.) Did you mean that???

Anyway....

Your code worked ok for me.

Maybe adding
Me.Repaint
to the end of that procedure will make it work ok for you. (I didn't need it,
though.)

Private Sub cboIllumination_Change()
Dim pg As Page
'disables all three pages
For Each pg In Me.mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If Me.cboIllumination.ListIndex < 0 Then
'do nothing
Else
With Me.mpgIllumination.Pages(Me.cboIllumination.ListIn dex)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub

Another method:

Private Sub cboIllumination_Change()
Dim iCtr As Long
If Me.cboIllumination.Value < 0 Then
Exit Sub
Else
With Me.mpgIllumination
For iCtr = 0 To .Count - 1
.Pages(iCtr).Visible = True 'CBool(iCtr =
Me.cboIllumination.ListIndex)
.Pages(iCtr).Enabled = CBool(iCtr =
Me.cboIllumination.ListIndex)
Next iCtr
End With
End If
End Sub

RyanH wrote:

I have a UserForm with a Combobox named "cboIllumination" and a MultiPage
name "mpgIllumination". When the UserForm is Intialized all the pages in the
mpgIllumination.Enabled = False and cboIllumination.ListIndex = 0.
Here is the problem. As the user changes cboIllumation I want the
associated page in mpgIllumination to be enabled and display the controls in
it. The code below will enable the page, but the controls are not visible
until I select it, why? Is it possible to make sure the controls are visible
when the pages enable property = True.

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex < 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

End Sub
--
Cheers,
Ryan


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Multipage Pages will not show controls when enabled

I don't have another guess.

The controls on the multipage pages showed up ok for me in my testing.

Any chance that it's a display problem--does the userform work ok on a different
pc?

If it does, maybe you can tweak a display setting????? (Like lowering the
hardware acceleration of the video card???)

Keep track of any existing settings so that you can turn them back to what they
were before you started tweaking!

RyanH wrote:

Yes I did mean to do that. These are the items in cboIllumination when the
Userform is Initialized. I have set the enable property for each page of the
mpgIllumination = False. So when "Single Row T12 HO Fluorescents" is
selected Page(0) should be enabled and the controls on that page should be
visible, but they are not. The Page enables, but the controls are not
visible until I click the Page Tab, then they appear. Then Me.Repaint did
not seem to work. Any other ideas or suggestions?

UserForm_Initialize()

With cboIllumination
.AddItem "No Illumination"
.AddItem "Single Row T12 HO Fluorescents"
.AddItem "Single Row T8 HO Fluorescents"
.AddItem "LEDs"
End With

End Sub

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub
--
Cheers,
Ryan

"Dave Peterson" wrote:

I created a small userform with a combobox on it with 3 entries. I added a
multipage with 3 pages.

I wanted the first item in the combobox to control page0, the 2nd item to
control page1 and the 3rd item to control page2. That seems different from what
you used. (You checked for < 0. 0 represents the first item in the combobox
list.) Did you mean that???

Anyway....

Your code worked ok for me.

Maybe adding
Me.Repaint
to the end of that procedure will make it work ok for you. (I didn't need it,
though.)

Private Sub cboIllumination_Change()
Dim pg As Page
'disables all three pages
For Each pg In Me.mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If Me.cboIllumination.ListIndex < 0 Then
'do nothing
Else
With Me.mpgIllumination.Pages(Me.cboIllumination.ListIn dex)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub

Another method:

Private Sub cboIllumination_Change()
Dim iCtr As Long
If Me.cboIllumination.Value < 0 Then
Exit Sub
Else
With Me.mpgIllumination
For iCtr = 0 To .Count - 1
.Pages(iCtr).Visible = True 'CBool(iCtr =
Me.cboIllumination.ListIndex)
.Pages(iCtr).Enabled = CBool(iCtr =
Me.cboIllumination.ListIndex)
Next iCtr
End With
End If
End Sub

RyanH wrote:

I have a UserForm with a Combobox named "cboIllumination" and a MultiPage
name "mpgIllumination". When the UserForm is Intialized all the pages in the
mpgIllumination.Enabled = False and cboIllumination.ListIndex = 0.
Here is the problem. As the user changes cboIllumation I want the
associated page in mpgIllumination to be enabled and display the controls in
it. The code below will enable the page, but the controls are not visible
until I select it, why? Is it possible to make sure the controls are visible
when the pages enable property = True.

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex < 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

End Sub
--
Cheers,
Ryan


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Multipage Pages will not show controls when enabled

I tried on two other computers, even tried redrawing a new userform and I
still have the issue. The Page is enabled, but the controls in the page do
not show until I select the enabled tab. Is there code that you know of that
will select a tab?


--
Cheers,
Ryan


"Dave Peterson" wrote:

I don't have another guess.

The controls on the multipage pages showed up ok for me in my testing.

Any chance that it's a display problem--does the userform work ok on a different
pc?

If it does, maybe you can tweak a display setting????? (Like lowering the
hardware acceleration of the video card???)

Keep track of any existing settings so that you can turn them back to what they
were before you started tweaking!

RyanH wrote:

Yes I did mean to do that. These are the items in cboIllumination when the
Userform is Initialized. I have set the enable property for each page of the
mpgIllumination = False. So when "Single Row T12 HO Fluorescents" is
selected Page(0) should be enabled and the controls on that page should be
visible, but they are not. The Page enables, but the controls are not
visible until I click the Page Tab, then they appear. Then Me.Repaint did
not seem to work. Any other ideas or suggestions?

UserForm_Initialize()

With cboIllumination
.AddItem "No Illumination"
.AddItem "Single Row T12 HO Fluorescents"
.AddItem "Single Row T8 HO Fluorescents"
.AddItem "LEDs"
End With

End Sub

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub
--
Cheers,
Ryan

"Dave Peterson" wrote:

I created a small userform with a combobox on it with 3 entries. I added a
multipage with 3 pages.

I wanted the first item in the combobox to control page0, the 2nd item to
control page1 and the 3rd item to control page2. That seems different from what
you used. (You checked for < 0. 0 represents the first item in the combobox
list.) Did you mean that???

Anyway....

Your code worked ok for me.

Maybe adding
Me.Repaint
to the end of that procedure will make it work ok for you. (I didn't need it,
though.)

Private Sub cboIllumination_Change()
Dim pg As Page
'disables all three pages
For Each pg In Me.mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If Me.cboIllumination.ListIndex < 0 Then
'do nothing
Else
With Me.mpgIllumination.Pages(Me.cboIllumination.ListIn dex)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub

Another method:

Private Sub cboIllumination_Change()
Dim iCtr As Long
If Me.cboIllumination.Value < 0 Then
Exit Sub
Else
With Me.mpgIllumination
For iCtr = 0 To .Count - 1
.Pages(iCtr).Visible = True 'CBool(iCtr =
Me.cboIllumination.ListIndex)
.Pages(iCtr).Enabled = CBool(iCtr =
Me.cboIllumination.ListIndex)
Next iCtr
End With
End If
End Sub

RyanH wrote:

I have a UserForm with a Combobox named "cboIllumination" and a MultiPage
name "mpgIllumination". When the UserForm is Intialized all the pages in the
mpgIllumination.Enabled = False and cboIllumination.ListIndex = 0.
Here is the problem. As the user changes cboIllumation I want the
associated page in mpgIllumination to be enabled and display the controls in
it. The code below will enable the page, but the controls are not visible
until I select it, why? Is it possible to make sure the controls are visible
when the pages enable property = True.

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex < 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

End Sub
--
Cheers,
Ryan

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Multipage Pages will not show controls when enabled

me.multipage1.value = 2

will select the 3rd page (0, 1, 2, ...)



RyanH wrote:

I tried on two other computers, even tried redrawing a new userform and I
still have the issue. The Page is enabled, but the controls in the page do
not show until I select the enabled tab. Is there code that you know of that
will select a tab?

--
Cheers,
Ryan

"Dave Peterson" wrote:

I don't have another guess.

The controls on the multipage pages showed up ok for me in my testing.

Any chance that it's a display problem--does the userform work ok on a different
pc?

If it does, maybe you can tweak a display setting????? (Like lowering the
hardware acceleration of the video card???)

Keep track of any existing settings so that you can turn them back to what they
were before you started tweaking!

RyanH wrote:

Yes I did mean to do that. These are the items in cboIllumination when the
Userform is Initialized. I have set the enable property for each page of the
mpgIllumination = False. So when "Single Row T12 HO Fluorescents" is
selected Page(0) should be enabled and the controls on that page should be
visible, but they are not. The Page enables, but the controls are not
visible until I click the Page Tab, then they appear. Then Me.Repaint did
not seem to work. Any other ideas or suggestions?

UserForm_Initialize()

With cboIllumination
.AddItem "No Illumination"
.AddItem "Single Row T12 HO Fluorescents"
.AddItem "Single Row T8 HO Fluorescents"
.AddItem "LEDs"
End With

End Sub

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub
--
Cheers,
Ryan

"Dave Peterson" wrote:

I created a small userform with a combobox on it with 3 entries. I added a
multipage with 3 pages.

I wanted the first item in the combobox to control page0, the 2nd item to
control page1 and the 3rd item to control page2. That seems different from what
you used. (You checked for < 0. 0 represents the first item in the combobox
list.) Did you mean that???

Anyway....

Your code worked ok for me.

Maybe adding
Me.Repaint
to the end of that procedure will make it work ok for you. (I didn't need it,
though.)

Private Sub cboIllumination_Change()
Dim pg As Page
'disables all three pages
For Each pg In Me.mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If Me.cboIllumination.ListIndex < 0 Then
'do nothing
Else
With Me.mpgIllumination.Pages(Me.cboIllumination.ListIn dex)
.Enabled = True
.Visible = True
End With
End If

Me.Repaint

End Sub

Another method:

Private Sub cboIllumination_Change()
Dim iCtr As Long
If Me.cboIllumination.Value < 0 Then
Exit Sub
Else
With Me.mpgIllumination
For iCtr = 0 To .Count - 1
.Pages(iCtr).Visible = True 'CBool(iCtr =
Me.cboIllumination.ListIndex)
.Pages(iCtr).Enabled = CBool(iCtr =
Me.cboIllumination.ListIndex)
Next iCtr
End With
End If
End Sub

RyanH wrote:

I have a UserForm with a Combobox named "cboIllumination" and a MultiPage
name "mpgIllumination". When the UserForm is Intialized all the pages in the
mpgIllumination.Enabled = False and cboIllumination.ListIndex = 0.
Here is the problem. As the user changes cboIllumation I want the
associated page in mpgIllumination to be enabled and display the controls in
it. The code below will enable the page, but the controls are not visible
until I select it, why? Is it possible to make sure the controls are visible
when the pages enable property = True.

Private Sub cboIllumination_Change()

Dim pg As Page

'disables all three pages
For Each pg In mpgIllumination.Pages
pg.Enabled = False
Next pg

'enables the associated page that was selected in listbox
If cboIllumination.ListIndex < 0 Then
With mpgIllumination.Pages(cboIllumination.ListIndex - 1)
.Enabled = True
.Visible = True
End With
End If

End Sub
--
Cheers,
Ryan

--

Dave Peterson


--

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
Use tab key to move between controls on multipage Dale Fye Excel Programming 0 October 15th 07 04:50 PM
Identifying controls on MultiPage Pages Rhumba Excel Programming 2 February 7th 06 03:29 PM
How to loop through controls on a MultiPage 42N83W Excel Programming 11 February 14th 05 11:32 PM
Multipage Controls - Experts Only Dee Veloper[_2_] Excel Programming 1 January 25th 05 11:57 PM
looping through userform controls changing enabled and locked properties JulieD Excel Programming 2 August 14th 04 12:44 PM


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

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

About Us

"It's about Microsoft Excel"