Results 1 to 5 of 5

Thread: VScroll1 show black thumb

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    172

    VScroll1 show black thumb

    Hello
    when i click VScroll button thumb of VScroll show color black
    why picture attach
    Attached Images Attached Images  

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,260

    Re: VScroll1 show black thumb

    kako,

    I know ... I hate that. When I use those built-in scroll bars, I always do something to immediately get the focus off of them after the user is done, so I don't have to see that black fuzz.

    I just checked a certain instance where I do this. At the bottom of both the "Change" and "Scroll" events, I just pick another reasonable control, and use .SetFocus to get the focus off of the VScrollBar.

    Good Luck,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    172

    Re: VScroll1 show black thumb

    i know .SetFocus but
    when user click more then one click scroll button not thumb scroll
    show black again show

  4. #4
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: VScroll1 show black thumb

    the typical solution is to subclass it, or use a different scrollbar.

  5. #5
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,000

    Re: VScroll1 show black thumb

    The black pattern is the caret of the scrollbar, letting you know it has the active input.
    Why not hide the caret?
    Code:
    Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long) As Long
     
    Private Sub VScroll1_GotFocus()
      HideCaret VScroll1.hwnd
    End Sub
    The caret is created whenever the control with a caret gets the focus, so you have to hide the caret in the GotFocus event to hide the newly created caret each time.

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