Hi,
I have a text label in my app, lab_terms, which contains Terms and Conditions. It is scrollable and contains more text than will fit on a single screen.
On the same screen there is a button, btn_Next, that advances the user to the next screen.
I'm want to use DisplayMode to disable the button until the user has scrolled to the end of lab_terms, but I'm not having any luck.
Is this possible? Or am I wishing for a beer and money tree again?
A very good point.
Thanks again
Hi @Matt_uhb ,
Indeed you're right, instead of referencing the Slider.Max, the Slider.Min property should be referenced to make sure the user has scrolled to the bottom. I'll amend the post you marked as the solution.
The reason I reference this property instead of a hardcoded value is because the content of the label may change over time. With these settings, the solution will automatically adapt to the changes instead of you having to make changes in multiple places to get things to work again.
Ok, first of all, genius solution, @BCBuizer, thanks.
However, the way it works is the opposite of the desired behaviour, i.e. as it is, the button is initially enabled, then becomes disabled as you slide it.
So I set the slider (sld_termsScroll) height to the height of my container and dropped a temporary label in there with the Text value as sld_termsScroll.Value to show me what the min value would be at when at the bottom of the scroll (-1813).
I then set the DisplayMode of the button to
If(sld_termsScroll.Value < -1800, DisplayMode.Edit, DisplayMode.Disabled)
And it is all good.
Thanks again for your help. have a good one.
Matt.
Hi @Matt_uhb ,
COme to think of it, the slider is probably more user friendly and easier to implement. The setup is similar to the one described before, but instead of 2 icons, use a slider.
The following property settings should be used:
Label:
AutoHeight = true
Y = Slider.Value
Slider:
Default = Self.Min
Layout = Layout.Vertical
Max = 0
Min = -Label.Height + Container.Height
ShowValue = false
The Slider.Value property can now be used to determine if the user is at the bottom to enable the button:
If(Slider.Value = Slider.Min, DisplayMode.Edit, DisplayMode.Disabled)
Resetting the slider will move the label back to the top.
Hi @Matt_uhb ,
As far as I know there is now property to reference which will return the where the user has scrolled to for a Label control.
What you can do, is build your own scroll function that does include this functionality using a container, a label and some icons:
As you can see the label is bigger than the container, but the part outside of the container is not visible. By clicking the arrow icons the user can scroll down. This works using a variable, which you can then leverage to keep track of where the user is scrolling.
The property settings for this:
Label
AutoHeight = true
Y = varScroll
Icon Up
DisplayMode = If(varScroll = 0, DisplayMode.Disabled,DisplayMode.Edit)
OnSelect = UpdateContext({varScroll: varScroll+50})
Icon Down
DisplayMode = If(-varScroll+ Container.Height >= Label.Height, DisplayMode.Disabled, DisplayMode.Edit)
OnSelect = UpdateContext({varScroll: varScroll-50});
If(
-varScroll+ Container1.Height >= Label5.Height &&
!varScrolledToBottom,
UpdateContext({varScrolledToBottom:true})
);
With these formulas, varScrolledToBottom will be set to true the first time the user scrolls to the bottom and will remain true even if the user scroll back up. It can be referenced directly in the DisplayMode property of the button to be enabled:
If(varScrolledToBottom, DisplayMode.Edit, DisplayMode.Disabled)
Please do make sure to properly initialize the variables, for instance in the OnVisible property of the screen that has this functionality:
UpdateContext({varScroll:0, varScrolledToBottom:false})
Edit: To improve the user experience, you may even throw a slider in the mix.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2