Solved

Scroll Increment

Posted on 2006-06-22
Medium Priority
225 Views
How do you make a scroll bar increment +/- .1 or less.
0
Question by:pat_cunningham
• 2

LVL 9

Expert Comment

ID: 16966356
incrementation of scroll bar in decimal values is not allowed in generic control. You may design one control for that sake.
0

LVL 19

Expert Comment

ID: 16966516
or for example if you want your scroll bar to go from 0 to 10 with .1 steps

Set Min = 0
Set Max = (10/.1)

Then on Value you could do:

msgbox (vSlider1.value * .1 )

Do you see how this is simulating the decimal values? Just an idea
0

LVL 19

Accepted Solution

BrianGEFF719 earned 1000 total points
ID: 16966530
Here is a working example, this example goes from 0 to 10 with a horinzontal scroll bar named HScroll1, it steps by .1 increments.

Private dblStep As Double
Private lngScrollMax As Long

dblStep = 0.1
lngScrollMax = 10

HScroll1.Min = 0
HScroll1.Max = (lngScrollMax / dblStep)
HScroll1.SmallChange = 1
HScroll1.LargeChange = 2

End Sub

Private Sub HScroll1_Change()
Dim dblValue As Double
dblValue = HScroll1.Value * dblStep

MsgBox "The Value is really: " & dblValue
End Sub
0

Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.