Computer Science Canada

Scrollbar help

Author:  Nitemare [ Thu Aug 17, 2006 7:57 pm ]
Post subject:  Scrollbar help

How do i make a scrollbar that changes a timer's interval?

Author:  NikG [ Thu Aug 17, 2006 11:36 pm ]
Post subject: 

You'll have to be a bit more specific...

This is my answer to your vague 1-liner:
Create a scrollbar control and set the max and min intervals you want, create a timer control, in the scrollbar's onchange or onscroll procedure, simply set the timer's interval value to the scrollbar's value.

Author:  Nitemare [ Fri Aug 18, 2006 8:20 am ]
Post subject: 

If that means when you scroll the scrollbar from side to side the timer's interval value changes, then yes.

Author:  cool dude [ Fri Aug 18, 2006 11:51 am ]
Post subject: 

double click on your scroll bar and the code window opens. then try something like so:

code:

Timer1.Interval = Timer1.Interval + 10


everytime u use the scroll bar the timer interval will increase by 10

hope that helps

Author:  NikG [ Fri Aug 18, 2006 1:10 pm ]
Post subject: 

cool dude's method works if you don't want to set a maximum and minimum interval that the user can set, but the actual scroll bar may look a little weird that way.

What I suggested works if you need to set a min/max.

(A min might be necessary... you don't want a negative interval.)

Author:  Echo [ Sun Aug 20, 2006 1:29 pm ]
Post subject: 

Would it be better to use a trackbar instead? Or do you need it to be vertical?


: