Slider and Textfield

Hey all, I have possibly an easy question (but its driving me crazy)

How would I go about setting the value of the slider using a textfield?

As in, I put the number “50” into the textfield and the slider.value changes to 50.

I have a slider with a maximum value of 100 and a textfiled. I have tried

Slider1.value = (Textfield1.text)

it is telling me it has expected an integer but got a string.

any help or guidance would be greatly appreciated!

Slider1.value = Val(Textfield1.text)

or

Slider1.value = Textfield1.text.ToInteger

1 Like

Thank you Keving!

The top one worked beautifully.

For basic concepts, you can read the book available there:
https://www.xojo.com/resources/learn.php

I hope you will enjoy it.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.