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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one way to scroll stop grab handle flashing (focus)

Status
Not open for further replies.

Cresby

Programmer
Aug 15, 2002
287
GB
there are no properties or events that I could find that would trap the event where the scroll grab handle has focus and flashes. This can happen if the nadle is just clicked (say).
My solution was to have a timer on 500 mS and have it set focus to a (visible but "behind") control called focusobject.

eg

Sub Timerf_Timer()
focusobject.SetFocus
End Sub

Anyone with a better idea on how to find-out if a scroll object has focus (there is no OnFocus event for scroll)
 
>>Anyone with a better idea on how to find-out if a scroll object has focus (there is no OnFocus event for scroll)

There is a GotFocus and a LostFocus event for simple scroll bars like all other controls. Me.ActiveControl also refers to the scroll bar if it has got focus.
Are you talking about standard scroll bars or flat scroll bars or scroll bars embedded within other controls?

(Flat scrollbars don't have focus events because they don't receive focus.)
 
Thanks for the thought - needs testing but how many blind alleys? this looked like one to me.
Not at my machine right now but not sure if got focus would be any better than the timer wheeze because it has to allow normal operation then transfer focus and focus will be maintained while the mouse is clicked - it would be forever flickering with the mousedown I would have thought as the user may not release immediately. That was my reasoning. Lost focus is what I aim to achieve so that is not going to solve the problem. I will look anew............
 
Hi,
I tend to send focus away from scrolbars in their "_change" event.

Steve


 
Cresby, what I understand is that you want to get rid of the focus from the scroll bar so that the flashing of the scroll bar thumb is avoided (which of course looks ugly). Am I right?

If this is so than you should use the flat scroll bars. (either in flat or 3d mode) Flat scroll bars do not capture keyboard focus and thus also do not flicker.
 
Hypetia

Doh
I have it working from Onfocus in a simple program but it is getting a repetitive loop from somewhere in the prog proper. Confused? - you will be. It is a potential hazard anyway so breakpoint city here I come.

steveouthwaite
The change event doesn't cover the case where you click the handle but make no change which is why I posted.

The pro is that the timer wheeze hits both scrolls and if I bothered to try it everywhere would action the 100 other focus issues I have covered. However some of the "issues" are spaghetti cases, pull one and the pile wobbles.

the con is the resources taken by the timer which is not that much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top