Thread: winxp style scrollbars.

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    161

    winxp style scrollbars.

    I am able to make the scrollbars using showscrollbar and edit its values using setscrollpos/range. Now how do I set the width of the scrollbar. E.g. if the value is 0 then the thumb should take up all the room in the scrollbar or if it is arount 50 it should take about 40% of the room where the person can move the thumb. I could do this using one of MS controls but they don't have the XP style.

    Thanx in advance!

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>Now how do I set the width of the scrollbar.<<

    If you mean 'thumb dimensions' then I think this is done via SetScrollPos in response to WM_VSCROLL/WM_HSCROLL messages, which you are probably aware of.Perhaps there may be something of use to you here. Sorry I can't be more helpful on this one.

    >>I could do this using one of MS controls but they don't have the XP style. <<

    Using Windows XP Visual Styles.

    The quickest/easiest way to use xp visual styles is to call InitCommonControlsEx (link with comctl32.lib) and include an xp manifest file in the same directory as your executable. This is good for all controls ie. both common and standard controls (such as scrollbars).
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    161
    Thanx I founded. I found other posts with a similer question. to do this without using any extra controls all api. use setscrollinfo for the SCROLLINFO structure nPage will determine the size of the thumb.

    Hope that helps any one else with this problem!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. winxp style background color problem
    By johny145 in forum Windows Programming
    Replies: 0
    Last Post: 07-06-2005, 10:22 AM
  4. WS_EX_COMPOSITED style (double buffering) problems
    By JasonD in forum Windows Programming
    Replies: 2
    Last Post: 10-12-2004, 11:21 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM