You could convert the EventData() to a float and divide the result ..
' trackbar with float value
Global win:TGadget=CreateWindow("trackbar",50,50,286,114,0,9)
Global tb:TGadget=CreateSlider(40,24,192,21,win,SLIDER_TRACKBAR|SLIDER_HORIZONTAL)
SetSliderRange tb,0,1000
SetSliderValue tb,25
SetStatusText win,"(move slider)"
Repeat
Select WaitEvent()
Case EVENT_GADGETACTION
Select EventSource()
Case tb
SetStatusText win,Float(EventData())/100.0
End Select
Case EVENT_WINDOWCLOSE
Exit
End Select
Forever
End
|