Results 1 to 17 of 17

Thread: How can I change the scrollbar color?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    13

    Question How can I change the scrollbar color?

    How can I change the scrollbar color?

  2. #2
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545

  3. #3
    DaoK
    Guest
    scroll bar and progress bar is not the same Jester.

  4. #4
    Member
    Join Date
    Dec 2001
    Location
    ny
    Posts
    38
    He said scrollbar.

    I believe the only way would be to subclass it. I don't really know how, but I was going to try sometime soon. If I do, I'll post it.

  5. #5
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    I'm sorry Its christmas eve man I'm allowed to be illiterate today

  6. #6
    DaoK
    Guest
    You can not change the color of scroll bar.

  7. #7
    Member
    Join Date
    Dec 2001
    Location
    ny
    Posts
    38
    Yes, you can.

  8. #8
    DaoK
    Guest
    vcv I know you can do it with html but we are talking about VB here.

    And instead of a "Yes" give the answer......

  9. #9
    Member
    Join Date
    Dec 2001
    Location
    ny
    Posts
    38
    I know we're talking about VB.

    I haven't attempted it, but I will sometime this week.

  10. #10
    DaoK
    Guest
    I do not see how you can do that because no api who can do that and you can not change the property of the scrollbar... maybe some one have made a ocx but I doubt.

  11. #11
    Member
    Join Date
    Dec 2001
    Location
    ny
    Posts
    38
    SUBCLASSING

  12. #12
    DaoK
    Guest
    Well I do not understand what is SubClassing... Can you tell me what is it and how to use it ?

  13. #13
    Member
    Join Date
    Dec 2001
    Location
    ny
    Posts
    38
    Use SetWindowLong to specify the address of new Window Procedure via the AddressOf operator. The new procedure (function in VB) must have certain parameters. hWnd, uMsg, wParam, lParam. I think that's the order too... In the function, you handle the messages yourself...or at least the ones you can to behave differently. Like you can only have WM_SIZE, and then use CallWindowProc with the old procedure address (which you should store from the return value of the call to SetWindowLong), and parameters to let windows handle the rest of the stuff.

    For scrollbars, you may handle.. WM_DRAWITEM and WM_MEASUREITEM to draw different colors. That's how you change the appearance of menus at least.

  14. #14
    Fanatic Member Gandalf_Grey_'s Avatar
    Join Date
    Oct 2001
    Location
    the 42nd dimension
    Posts
    665
    hmmm i know someone who has written a custom control. If i can find it i will put it on this topic. I don't know if it uses colours though, it could be modified

  15. #15
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    I found a custom scrollbar ocx on www.planetsourcecode.com some weeks ago.
    Here is the link:
    http://www.planetsourcecode.com/xq/A...s/ShowCode.htm
    Baaaaaaaaah

  16. #16

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    13
    I found a solution here
    http://www.vb-world.net/tips/tip8.html
    The problem is that the colour then changes for all the application.

  17. #17

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    13
    If we find a solution for the scrollbar, we can probably use it for controls like the TabStrip too.

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