I am trying to figure out a way to use Slider Control 6.0 to allow a user to select a range. For example slider would be from 0-1000 and the user can hold shift down and select 200-375.
I found some code online but it refererences using the slider MouseDown and MouseUp events. When I add my slider to my form I do not get those events for my slider. (I only get on updated, enter, exit, got focus and lost focus).
Am I missing something?? Is there a better/cooler way I can allow the user to select a range??
Thanks in advance!!
This is the code I was looking at.
Code:
Private Sub Form_Load()
sldSelect.SelectRange = True
End Sub
Private Sub sldSelect_MouseDown _
(Button As Integer, Shift As Integer, _
x As Single, y As Single)
If Shift = 1 Then
sldSelect.SelStart = sldSelect.Value
' Set previous SelLength (if any) to 0.
sldSelect.SelLength = 0
End If
End Sub
Private Sub sldSelect_MouseUp _
(Button As Integer, Shift As Integer, _
x As Single, y As Single)
If Shift = 1 Then
' If user selects backwards from a point,
' an error will occur.
On Error Resume Next
' Else set SelLength using SelStart and
' current value.
sldSelect.SelLength = _
sldSelect.Value - sldSelect.SelStart
Else
'If user lifts SHIFT key, set SelLength
' to 0 (to deselect the SelRange) and exit.
sldSelect.SelLength = 0
End If
End Sub