Testing whether a page in MultiPage is active

J

John G.

I got an 8 page help narrative (userform) and have needed to add a vertical
scroll bar to the last page (code below). Because there is no immediate
indication that addition information is not being shown, I would like to have
a label caption (say below the multipage control) anounce "Scroll down for
more ...." showing when this page is activated and/or the scroll bar is at
the top. Upon scrolling, I would like to shut off the label. The scroll is
only 1.55X the control height so upon the first movement of the scroll bar it
is evident that additional information is available. Also, the label caption
would be turned off upon exiting the page.
Thx in advance. John G.
--------------------------------
Private Sub UserForm_Initialize()

Multipage1.Pages(7).ScrollBars = fmScrollBarsVertical
Multipage1.Pages(7).KeepScrollBarsVisible = _
fmScrollBarsNone
Multipage1.Pages(7).ScrollHeight = 1.55 * _
Multipage1.Height
Multipage1.Pages(7).ScrollTop = 0

End Sub
 
J

John G.

Well, finally figured one out for myself. Code is below:
-------------------------
Private Sub UserForm_Initialize()

MultiPage1.Pages(7).ScrollBars = fmScrollBarsVertical
MultiPage1.Pages(7).KeepScrollBarsVisible = _
fmScrollBarsNone

MultiPage1.Pages(7).ScrollHeight = 1.55 * _
MultiPage1.Height

MultiPage1.Pages(7).ScrollTop = 0
MultiPage1.Value = 0

End Sub
---------------------------------------------------------
Private Sub Multipage1_Change()

Select Case MultiPage1.Value
Case 7
lblScrollMore.Visible = True
Case Else
lblScrollMore.Visible = False
End Select

End Sub
---------------------------------------------------------
Private Sub MultiPage1_Scroll(ByVal Index As Long, ByVal ActionX As _
MSForms.fmScrollAction, ByVal ActionY As MSForms.fmScrollAction, _
ByVal RequestDx As Single, ByVal RequestDy As Single, ByVal ActualDx _
As MSForms.ReturnSingle, ByVal ActualDy As MSForms.ReturnSingle)

Select Case MultiPage1.Pages(7).ScrollTop
Case Is < 5
lblScrollMore.Visible = True
Repaint
Case Else
lblScrollMore.Visible = False
End Select

End Sub
--------------------------------------------
Private Sub cmbHelp_Finish_Click()

Unload Me

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top