Scrolling in Multipages

O

Omar

Guys,

I have created a userform where I have put a multipage in
it. In each page of this multipage I'm putting alot of
things which causes me to enable the vertical scrolling
obtion on in the property of each page. However, I could
not get it working. For some reason this option is not
working. although it shows the scroll bar at the right
of the form it does not work; i.e.; it does not show the
rest of the buttons and text boxes at the bottom of the
form.

Can any body help me with this.
 
G

Greg Wilson

You seem to be getting ingnored. What did you set the
Scrollheight property to?

The following code will is proven to work in xl2000. You
need only to run the macro. You may have to correct for
wordwrap and for the doubling of periods within With/End
With statements. Test it and see if it works. If not
we'll need more info.

Sub TestScrollbars()
Dim i As Integer, ii As Integer
Dim UF As Object, TB As Control
Dim Multi As MultiPage
Set UF = Application.VBE. _
ActiveVBProject.VBComponents.Add(3)
UF.Properties("Height") = 200
UF.Properties("Width") = 130
Set Multi = UF.Designer.Controls.Add("Forms.MultiPage.1")
With Multi
..Height = 160
..Width = 115
..Top = 5
..Left = 5
End With
For i = 0 To 1
Multi.Pages(i).ScrollBars = 2
Multi.Pages(i).ScrollHeight = 350
For ii = 1 To 20
Set TB = Multi.Pages(i).Controls.Add("Forms.TextBox.1")
With TB
..Font.Size = 8
..Left = 10
..Top = ii * 15 + 5
..Height = 15
..Width = 40
..Text = "Test"
End With
Next ii
Next i
VBA.UserForms.Add(UF.Name).Show
ThisWorkbook.VBProject.VBComponents.Remove UF
End Sub

Regards,
Greg
 

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