How can I change the range of a slider in runtime in code for TouchGFX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-03 9:05 AM
Hi,
I have two sliders that I want dependent on one another. Slider1 has a minimum value of 0 and Slider2 has a maximum value of 50. How can I make it so that the maximum value for Slider1 is never greater than the minimum value for Slider2? I.e. if I move Slider2 to 28, then the Slider1 range changes to 0-27. Please let me know if this is doable. Thank you for your help in advance.
Solved! Go to Solution.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-04 4:25 AM
Hello @tv9 ,
Yes it is possible to change the value of the slider at runtime.
To do so, just use the setvaluerange function.
You can look at the API to see all the functions available for each widget.
Please find attached an example of slider value change at runtime.
Regards,
Software engineer at ST (TouchGFX)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-04 4:25 AM
Hello @tv9 ,
Yes it is possible to change the value of the slider at runtime.
To do so, just use the setvaluerange function.
You can look at the API to see all the functions available for each widget.
Please find attached an example of slider value change at runtime.
Regards,
Software engineer at ST (TouchGFX)
