ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MultiPage Scroll Bar (https://www.excelbanter.com/excel-programming/402477-multipage-scroll-bar.html)

Brandt

MultiPage Scroll Bar
 
I am trying to get the horizontal scroll bar on a MultiPage page to work. I
have a main MultiPage (MultiPage1). On each page of the main MP there is
another (sub-)MultiPage (i.e. MultiPage2 is on Page1 (index 0) of
MultiPage1). The following code works to insert Horizontal Scroll Bars on
the correct page (of the sub- MultiPage) and with the correct horizontal
scroll range, but nothing I do will affect the ScrollLeft Property. (I've
included 3 examples of what I have tried - none of them do anything.) I do
not get any kind of errors, just a scroll bar that is positioned wherever
excel wants it (usually about 1/8 of the way from the left edge). As a note,
I have tried a Me.Repaint at the end of the Sub with no effect.

Thanks in advance for any help!!

Private Sub UserForm_Initialize()
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84CE0080
MultiPage2.Pages(0).ScrollBars = fmScrollBarsHorizontal
MultiPage2.Pages(0).KeepScrollBarsVisible = fmScrollBarsHorizontal
MultiPage2.Pages(0).ScrollWidth = 805
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Pages(0).ScrollWidth -
MultiPage2.Width
MultiPage2.Pages(0).ScrollLeft = 0
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Width / 2
End Sub

FSt1

MultiPage Scroll Bar
 
hi
i did a search on multipage and multisheet. got nothing. can you define what
you mean by multipage?

regards
FSt1

"Brandt" wrote:

I am trying to get the horizontal scroll bar on a MultiPage page to work. I
have a main MultiPage (MultiPage1). On each page of the main MP there is
another (sub-)MultiPage (i.e. MultiPage2 is on Page1 (index 0) of
MultiPage1). The following code works to insert Horizontal Scroll Bars on
the correct page (of the sub- MultiPage) and with the correct horizontal
scroll range, but nothing I do will affect the ScrollLeft Property. (I've
included 3 examples of what I have tried - none of them do anything.) I do
not get any kind of errors, just a scroll bar that is positioned wherever
excel wants it (usually about 1/8 of the way from the left edge). As a note,
I have tried a Me.Repaint at the end of the Sub with no effect.

Thanks in advance for any help!!

Private Sub UserForm_Initialize()
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84CE0080
MultiPage2.Pages(0).ScrollBars = fmScrollBarsHorizontal
MultiPage2.Pages(0).KeepScrollBarsVisible = fmScrollBarsHorizontal
MultiPage2.Pages(0).ScrollWidth = 805
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Pages(0).ScrollWidth -
MultiPage2.Width
MultiPage2.Pages(0).ScrollLeft = 0
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Width / 2
End Sub


FSt1

MultiPage Scroll Bar
 
and what version of excel are you using?
regards
FSt1

"FSt1" wrote:

hi
i did a search on multipage and multisheet. got nothing. can you define what
you mean by multipage?

regards
FSt1

"Brandt" wrote:

I am trying to get the horizontal scroll bar on a MultiPage page to work. I
have a main MultiPage (MultiPage1). On each page of the main MP there is
another (sub-)MultiPage (i.e. MultiPage2 is on Page1 (index 0) of
MultiPage1). The following code works to insert Horizontal Scroll Bars on
the correct page (of the sub- MultiPage) and with the correct horizontal
scroll range, but nothing I do will affect the ScrollLeft Property. (I've
included 3 examples of what I have tried - none of them do anything.) I do
not get any kind of errors, just a scroll bar that is positioned wherever
excel wants it (usually about 1/8 of the way from the left edge). As a note,
I have tried a Me.Repaint at the end of the Sub with no effect.

Thanks in advance for any help!!

Private Sub UserForm_Initialize()
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84CE0080
MultiPage2.Pages(0).ScrollBars = fmScrollBarsHorizontal
MultiPage2.Pages(0).KeepScrollBarsVisible = fmScrollBarsHorizontal
MultiPage2.Pages(0).ScrollWidth = 805
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Pages(0).ScrollWidth -
MultiPage2.Width
MultiPage2.Pages(0).ScrollLeft = 0
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Width / 2
End Sub


Brandt

MultiPage Scroll Bar
 
Sorry, had to step away for a minute.

MultiPage is an item with multiple pages which can be added to a userform
(see VBA help). It is one of the items available on the control toolbox. I
am using Excel 2003.

Brandt

"FSt1" wrote:

and what version of excel are you using?
regards
FSt1

"FSt1" wrote:

hi
i did a search on multipage and multisheet. got nothing. can you define what
you mean by multipage?

regards
FSt1

"Brandt" wrote:

I am trying to get the horizontal scroll bar on a MultiPage page to work. I
have a main MultiPage (MultiPage1). On each page of the main MP there is
another (sub-)MultiPage (i.e. MultiPage2 is on Page1 (index 0) of
MultiPage1). The following code works to insert Horizontal Scroll Bars on
the correct page (of the sub- MultiPage) and with the correct horizontal
scroll range, but nothing I do will affect the ScrollLeft Property. (I've
included 3 examples of what I have tried - none of them do anything.) I do
not get any kind of errors, just a scroll bar that is positioned wherever
excel wants it (usually about 1/8 of the way from the left edge). As a note,
I have tried a Me.Repaint at the end of the Sub with no effect.

Thanks in advance for any help!!

Private Sub UserForm_Initialize()
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84CE0080
MultiPage2.Pages(0).ScrollBars = fmScrollBarsHorizontal
MultiPage2.Pages(0).KeepScrollBarsVisible = fmScrollBarsHorizontal
MultiPage2.Pages(0).ScrollWidth = 805
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Pages(0).ScrollWidth -
MultiPage2.Width
MultiPage2.Pages(0).ScrollLeft = 0
MultiPage2.Pages(0).ScrollLeft = MultiPage2.Width / 2
End Sub



All times are GMT +1. The time now is 06:11 PM.

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