Linking a slider control with a textbox

Started by Iulian, January 31, 2012, 08:02:06 AM

Previous topic - Next topic

Iulian

Hi, I try to use for the first time a slider control, and I need some help with the following:

On my form I have a textbox in which integer numbers are inserted, and I want to link a slider with the textbox:

The min value of the slider I want to be 85% of the value which in the textbox is inserted, and the max value of the slider I want to be 115% of the same value.


(dcl_Control_SetText gaura_Form4_TextBox1 (rtos vc)) ;vc- is the variable that sets the integer number in TextBox1

(dcl_Control_SetMaxValue gaura_Form4_Slider1 (rtos (* vc (/ 115 100)) 2 0)); there I try to set the max value of the slider, but it won't...

; vc is an integer value.

How can I do this?

Thanks.



roy_043

(rtos ...) creates a string instead of an integer.
Try:
Code (autolisp) Select
(dcl_Control_SetMaxValue gaura_Form4_Slider1 (fix (* vc (/ 115.0 100.0))))

You should also be aware of this:
(/ 115 100) => 1
(/ 115.0 100.0) => 1.15

Iulian