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

blinking scroll bar thumb

Status
Not open for further replies.

dc20

Technical User
Dec 15, 2003
95
US
When I add a scroll bar to my excel file from the control toolbox, the thumb blinks (pulses like a cursor) after a clicking a change and making the thumb move.

I notice that when I manually select a surrounding cell, it does stop blinking, however when I have the program do a cell select after the scrollbar1_change, the scroll bar thumb is still blinking. Is there anyway to have it stop blinking ? Thanks in advance.
 
Hi dc20,

Can you give any more details about this? I can't replicate it in Excel 2K.

Enjoy,
Tony
 
Essentially, when I place a (vertical or horizontal) scroll bar on an excel page (97 or 2K, I've tried), then select the arrows (for small change) or click for large change the "thumb" that moves up and down starts blinking.
 
Hi dc20,

Yes, I understand what you're saying. And, on re-reading your post, I realise you're doing this in the Scrollbar Change Event. You can't Select a cell while the scrollbar control has the focus; you must first Select the sheet to shift the focus ..

Code:
Private Sub ScrollBar1_Change()
    Me.Select
Code:
' Select the Sheet
Code:
    [a1].Select
Code:
' Select your Cell
Code:
End Sub

Enjoy,
Tony
 
Hi Tony,

Actually my intent is just to get the scroll bar from blinking and the selection of another cell or object was just and effort to change the focus from the scroll bar to get it to stop blinking. I can manually select a cell and then the scroll bar thumb will stop blinking. Now, adding your two commands, selecting the sheet then the cell, DOES stop it from blinking, however the scrolling (while pressing on the top or bottom arrow - ie small change) only applies one increment of small change rather than continuous scrolling. I've seen a couple references to it on the web, but the proposed fixes which include setting Tabstop to False or Destroy Caret don't seem to work either.
I'm new here, so I hope it's ok to include a link that may help describe the problem
I tried adding
Code:
 ScrollBar1.SetTab = False
and it errors saying object doesn't support this property or method.
 
oops....

meant I added
Code:
Scrollbar1.TabStop = False

( I've tried so many things I'm losing track ).
 
Hi dc20,

Ok, a couple of things here.

Firstly, the Tabstop property refers to a Scrollbar on a UserForm (within which you can use Tab to move between Controls). You have a standalone Scrollbar which, as you have found out, does not have that property.

Next, all you need to do to move the focus off the Scrollbar in the Change Event is to select the Sheet - there is no need to select a Cell as well. BUT when you have done this (i.e. immediately after the change which triggers the Event), the Scrollbar no longer has the focus and no longer registers the fact that you are pressing the mouse button and so stops scrolling.

If you remove the code in the Change event you will get continuous scrolling, but you will also get the flashing which simply signifies the fact that the scrollbar has the focus. I don't see how, in code, you can know when you've scrolled enough. Rather than checking for a condition to stop scrolling, why not simply ignore the scrollbar and set the condition to true straightaway?

Somewhat strangely, perhaps, the scrollbar control does not have mouse events. It does have key events so if you are pressing the arrow keys to scroll you can trap when the key is let go but that isn't usual user behaviour.

I don't know if any of that really helps you, but I'm not sure what you're really trying to achieve.

Enjoy,
Tony
 
Hi Tony,

What I'm trying to achieve is being able to use the stand alone scroll bar without it blinking afterwards.

I spoke to another VBA programmer and he says that's just the way the scrollbar behaves; you scroll with it and it keeps blinking. (control box scroll bar not the forms scroll bar).

The mention of selecting a page or cell was only to get it to stop blinking. When we scroll this page or use any other scroll bar on a website, etc, I never
see it blinking afterwards - seems like a behavior that is unique to the stand alone bar and not really appealing to me. If I scroll this page, I don't have to select something else to change focus to get it to stop blinking.

You have provided me some options and also good information.
I do appreciate discussing this with you.

Thanks.
 
Hi dc20,

I understand what you want now and, as you say, I don't think you can have it - it's just not the way it works. Excel seems to need some visible way of indicating where the focus is and flashing the thumb is what it does with the scrollbar - the only way to stop it flashing is to move the focus but that also stops it responding. It could be better, couldn't it?

Sorry not to be more help.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top