How to control how the slider bar applied the commands

Hi

I am adding a slider bar to an application. Is there a way that I can tell when the value has changed and exh time it changes it undoes the last function and applies the new one. The code I am using looks like this
Dim text1 As String
Dim text2 As String
Dim title2 As String * 13
Dim sliderval As Integer


ret = IpDocGetStr(INF_NAME, DOCSEL_ACTIVE, title)
 text1 = title
 text2 = orig

If text1 = text2 Then
sliderval = Guihigh.Slider1.Value



ret = IpWsOverlay(overlay, sliderval, 0)

I need the slider val to be one function between two images at the moment it changes each time it is moved but then keeps applying the function rather than just changing it.
Any help appreciated.
eneateAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cool12399Commented:
Not exactly sure what you mean, but assuming you are using the Microsoft Common Controls
(from components->Microsoft Common Controls, i.e., MSCOMCTL.OCX)

then the Slider1_mouseMove event is called any time the slider is moved.

So if I understand what you are asking, -- you are saying -- if the slider changes value (i.e.,
from 10 to 11), then you want to call a function to do something. If that is the case, then you
would do this. Add a textbox, and a slider to your form. Then add this code:

Dim previousSlideValue as Integer

Private Sub Form_Load()
previousSlideValue = -1
end sub

Private Sub Slider1_MouseMove(Button as Integer, Shift as Integer, x as Single, y as Single)
  if previousSlideValue <> slider1.value then
     previousSlideValue = slider1.value
     ' CALL YOUR FUNCTION HERE! I.E., displaying a value in a textbox!
     text1.text = slider1.value
  end if

End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eneateAuthor Commented:
Hi

Thanks for the feedback. It 's all now working fine and you gave me some new ideas.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.