Results 1 to 9 of 9

Thread: Need help with scrollbars please

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    765

    Need help with scrollbars please

    There are a number of problems with VB6 scrollbars:

    Problem #1:
    I remember that in the past, when I had a scrollbar on a form, one of various ways of scrolling it was to right-click between the indicator and the top or bottom arrows of the scrollbar.
    That right-click showed a popup menu with a number of menu items for the user such as "Scroll Here", "Scroll Up", "Scroll Down", etc.
    The user could click on one of those menu items to scroll.

    But now, I see that that popup menu does no longer pop up when I right-click between the indicator and the top or bottom arrows of the scrollbar.
    This screen print shows exactly what I mean:
    https://i.imgur.com/KvJIkSm.jpeg

    To clarify what that popup menu is, I can show you an example from the Windows Explorer's scrollbar:
    https://i.imgur.com/ABbOnQz.jpeg

    I just checked a number of my VB6 projects where I had used scrollbars and that popup menu no longer pops up in any of them.

    I remember it did show up in the past.
    I don't know why it no longer shows up.
    Does anybody know why?
    Please advise.

    Problem #2:
    If you look at the first screen print above, you will notice that the indicator in the scrollbar (on the bottom of the screen) is fuzzy (instead of having a solid color).
    Please compare it to the other scrollbar on the top of the screen (from an unrelated previous test).
    The top one looks fine. But the bottom one has a fuzzy (dotted) appearance.

    Problem #3:
    On this page:
    https://www.freetutes.com/learn-vb6/lesson10.html
    It says:
    There are two key events for scrollbar controls: the Change event fires when you click on the scroll bar arrows or when you drag the indicator; the Scroll event fires while you drag the indicator
    Therefore according to the above, SOMETIMES (in the case of dragging the indicator), both events are fired.

    However, I can't recreate ANY scenario (dragging, clicking, scrolling by keyboard, scrolling programmically or any other way of scrolling) that would fire both of those events.
    ANY way of scrolling (in my tests) fires only ONE of those two events. That is either the change event or the scroll event, but never both.

    Am I missing anything?

    Please help
    Thanks.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Need help with scrollbars please

    There was never a context menu for scrollbars.

    "Indicator" is pretty vague. But I assume you mean the thumb-box of the scrollbar. When a scrollbar has focus the thumb flashes several times and then goes "grayed" with a pattern if you are using the legacy Common Controls assembly. If the program uses Common Controls 6 instead the appearance is different.

    As for those events, they work exactly as described in the documentation. Read that, not goofy "tutes" somebody cobbled together.

  3. #3
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,140

    Re: Need help with scrollbars please

    Quote Originally Posted by IliaPreston View Post
    Problem #3:
    On this page:
    https://www.freetutes.com/learn-vb6/lesson10.html
    It says:

    Therefore according to the above, SOMETIMES (in the case of dragging the indicator), both events are fired.

    However, I can't recreate ANY scenario (dragging, clicking, scrolling by keyboard, scrolling programmically or any other way of scrolling) that would fire both of those events.
    ANY way of scrolling (in my tests) fires only ONE of those two events. That is either the change event or the scroll event, but never both.

    Am I missing anything?

    Please help
    Thanks.
    As you hold the mouse button down and drag the scroll box up and down (or left and right for a horizontal scollbar), the "Scroll" event will be raised multiple times. Release the mouse button and then the "Change" event is raised once.

    This is consistent with the concept of a "refinement drag", where you are dragging the scroll box around to reach the desired value, let it go, at which point the "Change" event is appropriately raised. After all, you aren't really committing the changed value of the scrollbar until you release the mouse button, so it wouldn't make sense if the "Change" event was raised repeatedly while dragging.

    Good luck.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Need help with scrollbars please

    You might be thinking of the FlatScrollBar (MSCOMCT2.OCX) too I suppose.

  5. #5
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    508

    Re: Need help with scrollbars please

    If that exists, that menu what I have ever used it.
    in Windows 10 in the Note Block right click and the menu appears

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    765

    Re: Need help with scrollbars please

    "Indicator" is pretty vague. But I assume you mean the thumb-box of the scrollbar
    That is true. I meant the thumb-box.
    Thanks for correcting me.

    As for those events, they work exactly as described in the documentation. Read that, not goofy "tutes" somebody cobbled together.
    Can you please provide the link to the documentation that you are talking about?

    Thanks.
    Ilia

  7. #7
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

    Re: Need help with scrollbars please

    I thought I remembered this. So I put a scrollbar on a form and right clicked it;
    Attached Images Attached Images  

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Need help with scrollbars please

    Ahh, that must be the Common Controls 6 scrollbar you get when your manifest selects the Common Controls 6 assembly.

  9. #9
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

    Re: Need help with scrollbars please

    Indeed so, I run my IDE manifested.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width