I've only just noticed this.
If I place a control (a button say) in a scrollview container with it's .X value greater than scrollview.W then the horizontal scrollbar is initiated and the control can be brought into view.
However if the .X position of the control is less than scrollview.X then the scrollbar is not initiated.
In other words, a child object to the right of the scrollview can be viewed whereas a child object to the right cannot.
Is this to be expected?
Scrollview question
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
- BruceSteers
- Posts: 1565
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Scrollview question
Probably the scrollview.Arrange settingbill-lancaster wrote: ↑Sunday 19th December 2021 11:55am I've only just noticed this.
If I place a control (a button say) in a scrollview container with it's .X value greater than scrollview.W then the horizontal scrollbar is initiated and the control can be brought into view.
However if the .X position of the control is less than scrollview.X then the scrollbar is not initiated.
In other words, a child object to the right of the scrollview can be viewed whereas a child object to the right cannot.
Is this to be expected?
Arrange.None will give freedom to place objects where you expect them to be and make scrollbars work as expected i should think.
and i don't get this ...
In other words, a child object to the right of the scrollview can be viewed whereas a child object to the right cannot.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: Scrollview question
Thanks Bruce
I thought I'd make it clearer with the last statement, unfortunately it should read:-
I thought I'd make it clearer with the last statement, unfortunately it should read:-
In other words, a child object to the right of the scrollview can be viewed whereas a child object to the LEFT cannot.
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: Scrollview question
Tried changing the arrange settings - makes no difference.
Perhaps you might try this:-
Thanks
Bill
Perhaps you might try this:-
Code: Select all
Public Sub Form_Open()
Dim hScrollview As New ScrollView(Me)
With hScrollview
.X = 10
.Y = 10
.W = 500
.H = 500
End With
Dim hFrame As New Frame(hScrollview)
With hFrame
.X = -100
.Y = -10
.W = 200
.H = 200
End With
Dim hFrame2 As New Frame(hScrollview)
With hFrame2
.X = 450
.Y = 50
.W = 200
.H = 200
End With
End
Bill
- BruceSteers
- Posts: 1565
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Scrollview question
Aah i see.
You cannot use negative numbers.
the box has been placed -100 to the scrollview.X 0 position so it's right.
you should place the frame at 0 and scroll the view +100 to get the same effect.
like this is how i'd do it ..
You cannot use negative numbers.
the box has been placed -100 to the scrollview.X 0 position so it's right.
you should place the frame at 0 and scroll the view +100 to get the same effect.
like this is how i'd do it ..
Public Sub Form_Open()
Dim hScrollview As New ScrollView(Me)
With hScrollview
.Name = "SView"
.ScrollBar = Scroll.Both
.Expand = True
.X = 10
.Y = 10
.W = 500
.H = 500
End With
Dim hFrame As New Frame(hScrollview)
With hFrame
.X = 0
.Y = 0
.W = 200
.H = 200
End With
Dim hFrame2 As New Frame(hScrollview)
With hFrame2
.X = 450
.Y = 50
.W = 200
.H = 200
End With
End
Public Sub Form_Show()
Dim hScrollview As ScrollView = Me["SView"]
hScrollview.ScrollX = 100
hScrollview.ScrollY = 20
End
If at first you don't succeed , try doing something differently.
BruceS
BruceS
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: Scrollview question
Thanks Bruce, so negative positions for child objects is not allowed, that explains it.
Thanks again,
Bill
Thanks again,
Bill
- BruceSteers
- Posts: 1565
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Scrollview question
Yeah, the scrollviews left edge 0 is as it is, the left edge. Then the view is scrolled and it's position is negative to the visible window but still 0 to the scrollview object, anything placed negative of that will remain there.
If at first you don't succeed , try doing something differently.
BruceS
BruceS