Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sliding Bar Gets Faster!!!

Status
Not open for further replies.

aliinal

Technical User
Jun 26, 2001
104
0
0
TR
Hi!
I'm making a sliding band by using a timer control.
I set timer's interval to 1 then i decrease the left property of the picturebox by 100 in timer event.
It seems to work without any problem.
But while moving the mouse over controls, or start button, or on desktop band gets faster. (Timer event occurs in a shorter interval)

Why this can be?
It interrupt people who tries to read the writing on the sliding bar.
I may accept any solutions. Like preventing timer control to do this or another way to slide a picturebox accross the screen...

Thanks
 
timer event is not accurate. Windows tries to do event every interval but might fail. Try regulating the timer

place in module:
dim Tsec as long
dim TLast as integer


place in form:
timer_Click()
if TLast <> second(time) then
Tsec=Tsec+1
TLast=second(time)
endif
if tsec >= 5 then 'put whatever time value you want
'do stuff here
tsec=0
endf
end sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top