ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to disable and enable multipage elements during runtime? (https://www.excelbanter.com/excel-programming/406695-how-disable-enable-multipage-elements-during-runtime.html)

Yajiv

How to disable and enable multipage elements during runtime?
 
I have a multipage with four pages. I want to enable them when some
condition is satisfied. How can i do that? The intelli-sense is not
displaying my page names.

Dave Peterson

How to disable and enable multipage elements during runtime?
 

Dim mCtr As Long
For mCtr = 0 To Me.MultiPage1.Pages.Count - 1
Me.MultiPage1.Pages(mCtr).Enabled = True
Next mCtr

To toggle the .enabled property:

With Me.MultiPage1.Pages(mCtr)
.Enabled = Not .Enabled
End With

Yajiv wrote:

I have a multipage with four pages. I want to enable them when some
condition is satisfied. How can i do that? The intelli-sense is not
displaying my page names.


--

Dave Peterson

Rick Rothstein \(MVP - VB\)[_1340_]

How to disable and enable multipage elements during runtime?
 
Try it this way...

With MultiPage1
For X = 1 To .Pages.Count
MultiPage1.Pages(X).Enabled = True
Next
End With

You can address individual pages via its Index in the Pages collection.

Rick


"Yajiv" wrote in message
...
I have a multipage with four pages. I want to enable them when some
condition is satisfied. How can i do that? The intelli-sense is not
displaying my page names.



Rick Rothstein \(MVP - VB\)[_1342_]

How to disable and enable multipage elements during runtime?
 
Whoops! Dave is right... the Indexes for MultiPage are zero-based, so my
code should have been...

With MultiPage1
For X = 0 To .Pages.Count - 1
MultiPage1.Pages(X).Enabled = True
Next
End With

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Try it this way...

With MultiPage1
For X = 1 To .Pages.Count
MultiPage1.Pages(X).Enabled = True
Next
End With

You can address individual pages via its Index in the Pages collection.

Rick


"Yajiv" wrote in message
...
I have a multipage with four pages. I want to enable them when some
condition is satisfied. How can i do that? The intelli-sense is not
displaying my page names.





All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com