Change values of slider during the app is running

Hi everyone,

I have a question concerning the slider control.
Is it possible to change the maximal and minimal values of the slider during the application is running?
If it is possible how can I realize that?

Yours sincerely,

Fabian Rogg

Yes, by using the Minimum and Maximum Propertys:

Just set NameOfYourSlider.Minimum = NewValue and/or NameOfYourSlider.Maximum = NewValue

Thank you for your answer Sascha!
I have currently the following code:

me.DMinimum = 0
me.DMaximum = 10
  If anarray_value <> 0 Then
    me.DMaximum = anarray_value
  End If

During my application is running the value anarray_value change, but the maximum of the slider is the same as by the beginning.

When do you update your slider value?

I am a bloody beginner at programming with xojo.
How can I update my slider value?
Is it the command myslider.Invalidate to update the slider value?

We all have been newbies once upon a time. So no need to curse.

Yes, you can update your slider. But when do you do this? In a loop, from another window? What do you do afterwards?

‘Me’ is either the control or a window during one of its events,

Let us assume the slider is on a window
And it is called mySlider

If this is code in a button somewhere, then you need to change the code:

me.DMinimum = 0 'this is done at design time me.DMaximum = 10

//assuming this is in a method or some button code If anarray_value <> 0 Then mySlider.Maximum = anarray_value End If //and optionally refresh it mySlider.Invalidate(false)

If you want to change the VALUE of the slider, then you dont change the maximum, you change the .Value property.

Thanks for all the quick help!
Jeff with your code works it fine!