How to enter Decimal values with a Slider control in a Label (0.01,0.02,0.03 etc.)
How to enter Decimal values with a Slider control in a Label (0.01,0.02,0.03 etc.)
API Declarations
'Controls used :
'Frame control Name :Frame1 (put Slider and Label controls on this Frame)
'Slider control Name : SliderChange Properties : Min 0 Max 10
'Label control Name : lblSliderChange
Rate How to enter Decimal values with a Slider control in a Label (0.01,0.02,0.03 etc.)
(1(1 Vote))
Private Function SliderExact() 'Function Name is SliderExact
Select Case SliderChange 'Name of Slider
Case Is = 0
SliderExact = 0 'Value
Case Is = 1
SliderExact = 0.01
Case Is = 2
SliderExact = 0.02
Case Is = 3
SliderExact = 0.03
Case Is = 4
SliderExact = 0.04
Case Is = 5
SliderExact = 0.05
Case Is = 6
SliderExact = 0.06
Case Is = 7
SliderExact = 0.07
Case Is = 8
SliderExact = 0.08
Case Is = 9
SliderExact = 0.09
Case Is = 10
SliderExact = 0.1
End Select
End Function
'Slider Change event
Private Sub SliderChange_Change()
lblSliderChange = SliderExact 'Call function
'Show value in Frame caption
Frame1.Caption = SliderExact
End Sub
How to enter Decimal values with a Slider control in a Label (0.01,0.02,0.03 etc.) Comments
No comments yet — be the first to post one!
Post a Comment