It is not possible to determine this behaviour automatically: you must create a callback for the control and inside the callback trap the EVENT_VAL_CHANGED event. In this event routine, you can get the control value (GetCtrlVal...) and based on the value determine the color of the slider area using SetCtrlAttribute passing ATTR_FILL_COLOR (and eventually ATTR_FILL_HOUSING_COLOR) as the parameter to update.
Please, pay attention that unlike other languages (e.g. visual basic) the control callback is NOT automatically called when you update the control. That is, every time you place a SetCtrlVal you must explicitly call the callback associated to the control (you can use CallCtrlCallback to do this).
Last note: you say "for a defined range...": note that it is not possible to paint part of the fill area in one color and part in another, in order to have a visual indication of the safe and hazardous area: you always will have ALL the area from 0 to the slider painted in one colour. To obtain this effect you must use a second control (for example a canvas) placed near or below the slide and paint the two coloured regions on the canvas, leaving the fill area painted in transparent so that the only visible parte of the control is the slider.
Message Edited by Roberto Bozzolo on 05-23-2005 05:58 PM