Solved

Subclassing scrollbars in list and tree controls

Posted on 2002-05-09
1
884 Views
Last Modified: 2013-11-20
How can I subclass the scrollbar inside a CListCtrl or a CTreeCtrl.  The method GetScrollBarCtrl returns NULL. My lists and tree are very nice but I'm stuck with ugly gray scrollbars. I only I could get a hold on it...
0
Comment
Question by:mahtieubrault
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 7000034
The so-called 'standard scrollbars' (the ones that appear when the WS_HSCROLL, WS_VSCROLL, or both styles are used when the windows is created) are not actual windows.  THey are elements of the non-client frame of the windows.  Thus, you can't get a handle to them and you can't do any sort of normal subclassing operation.  

The CWnd::GetScrollBarCtrl fn comes into play for CView-derived windows in which a separate CControlBar is created as a 'peer' to the windows that will be scrolled.
=-=-=--==-=-=-=-=-=-=-
Have you tried the InitializeFlatSB() and  FlatSB_SetScrollProp() APIs?  I have not, but it looks like a reasonable way to try out some cosmetic variations on std scrollbars.

-- Dan
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question