strange behaviour with vertical scrollbar 
Author Message
 strange behaviour with vertical scrollbar

Dear all
On my form I have a vertical scrollbar(VScroll1) and often(but not always) I
see strange behaviours:
If I press the up-arrow or the down-arrow(small change) of the Vscroll
control with the mouse then the slider is moving upwards or downwards as
expected.
If I press on the area between the arrow and the slider(large change) then
the following is happening:
sometimes the area between the arrow and the slider turns black and stays
black
sometimes it turns black but then changes to grey again.
If the area has turned black then sometimes if I just move the mouse over
the black area then the slider is moving without any mouse clicks. This has
happend only upwards so far, if the area has turned black in the lower part
of the vscroll control then moving the mouse over that area has never moved
the slider without any mouseclicks.
How can I prevent this?
I already put the following code into VScroll1_GotFocus event:
Picture1.Setfocus
to prevent blinking of the slider.
Both .SmallChange and .LargeChange properties are set to 1.
Regards
Peter


Tue, 14 Jun 2011 06:54:32 GMT  
 strange behaviour with vertical scrollbar

Quote:
> I already put the following code into VScroll1
> GotFocus event: Picture1.Setfocus to prevent
> blinking of the slider. Both .SmallChange and
> .LargeChange properties are set to 1.

Do you still have the same problem if you get rid of the Picture1.Setfocus
line? You can prevent the ScrollBar from flashing by setting its Tabstop
property to False.

Mike



Tue, 14 Jun 2011 16:36:43 GMT  
 strange behaviour with vertical scrollbar
Yes, the problem remains with or without Picture1.Setfocus.
Any Idea?
Regards
Peter


Quote:


>> I already put the following code into VScroll1
>> GotFocus event: Picture1.Setfocus to prevent
>> blinking of the slider. Both .SmallChange and
>> .LargeChange properties are set to 1.

> Do you still have the same problem if you get rid of the Picture1.Setfocus
> line? You can prevent the ScrollBar from flashing by setting its Tabstop
> property to False.

> Mike



Wed, 15 Jun 2011 03:08:40 GMT  
 strange behaviour with vertical scrollbar

Quote:
> Dear all
> On my form I have a vertical scrollbar(VScroll1) and often(but not always)
> I see strange behaviours:
> If I press the up-arrow or the down-arrow(small change) of the Vscroll
> control with the mouse then the slider is moving upwards or downwards as
> expected.
> If I press on the area between the arrow and the slider(large change) then
> the following is happening:
> sometimes the area between the arrow and the slider turns black and stays
> black
> sometimes it turns black but then changes to grey again.
> If the area has turned black then sometimes if I just move the mouse over
> the black area then the slider is moving without any mouse clicks. This
> has happend only upwards so far, if the area has turned black in the lower
> part of the vscroll control then moving the mouse over that area has never
> moved the slider without any mouseclicks.
> How can I prevent this?
> I already put the following code into VScroll1_GotFocus event:
> Picture1.Setfocus
> to prevent blinking of the slider.
> Both .SmallChange and .LargeChange properties are set to 1.

How long does it take for Change/Scroll event code to execute? You may want
to add test code:

Private Sub VScroll1_Change()
    Dim t As Single

    t = Timer

    ' Some code

    Debug.Print "VScroll1_Change: Time taken " & Timer - t
End Sub

Try adding the following code as well to see if anything makes the scrollbar
lose focus:

Private Sub VScroll1_LostFocus()
    Debug.Print "VScroll1_LostFocus called"
End Sub



Wed, 15 Jun 2011 04:22:41 GMT  
 strange behaviour with vertical scrollbar
Thanks for your hint!
I have put Form_Paint into the Vscroll1.Change sub which was consuming a lot
of time.
Now I call Form_Paint with a timer and just enable the timer with the Change
event.
With a interval of 100ms the problem can still be seen but with interval >=
200ms the problem disappeared.
Regards
Peter



Quote:


>> Dear all
>> On my form I have a vertical scrollbar(VScroll1) and often(but not
>> always) I see strange behaviours:
>> If I press the up-arrow or the down-arrow(small change) of the Vscroll
>> control with the mouse then the slider is moving upwards or downwards as
>> expected.
>> If I press on the area between the arrow and the slider(large change)
>> then the following is happening:
>> sometimes the area between the arrow and the slider turns black and stays
>> black
>> sometimes it turns black but then changes to grey again.
>> If the area has turned black then sometimes if I just move the mouse over
>> the black area then the slider is moving without any mouse clicks. This
>> has happend only upwards so far, if the area has turned black in the
>> lower part of the vscroll control then moving the mouse over that area
>> has never moved the slider without any mouseclicks.
>> How can I prevent this?
>> I already put the following code into VScroll1_GotFocus event:
>> Picture1.Setfocus
>> to prevent blinking of the slider.
>> Both .SmallChange and .LargeChange properties are set to 1.

> How long does it take for Change/Scroll event code to execute? You may
> want to add test code:

> Private Sub VScroll1_Change()
>    Dim t As Single

>    t = Timer

>    ' Some code

>    Debug.Print "VScroll1_Change: Time taken " & Timer - t
> End Sub

> Try adding the following code as well to see if anything makes the
> scrollbar lose focus:

> Private Sub VScroll1_LostFocus()
>    Debug.Print "VScroll1_LostFocus called"
> End Sub



Thu, 16 Jun 2011 04:10:37 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Datagrid Vertical Scrollbar

2. DataGrid Vertical ScrollBar Always On?

3. Using several listboxes with 1 vertical scrollbar (result of query)

4. help...with listbox's vertical scrollbar..

5. vertical scrollbar

6. Controling Vertical Scrollbar

7. ListView sorting with vertical scrollbar.

8. PictureBox and Vertical, Horizontal ScrollBar

9. Question: Optional vertical scrollbar and textbox?

10. MS Data Grid Ole DB - Vertical Scrollbar

11. Annoying Vertical ScrollBar

12. Listview and the Vertical scrollbar

 

 
Powered by phpBB® Forum Software