CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Jan 2009
    Posts
    399

    Coloring thumbs on CScrollBar

    I am trying to coloring thumbs on CScrollBar control ... in order to achieve that, I derived a class from CScrollBar, named CScrollbarExt, and I handled CtlColor:
    Code:
    protected:
    	//{{AFX_MSG(CScrollBarExt)
    	afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
    	//}}AFX_MSG
    and
    Code:
    HBRUSH CScrollBarExt::CtlColor(CDC* pDC, UINT nCtlColor) 
    {
    	// TODO: Change any attributes of the DC here
    
    	// TODO: Return a non-NULL brush if the parent's handler should not be called
    	return m_Brush;
    	return NULL;
    }
    of course, m_Brush has a custom color, and scrollbar shaft has custom color ... but how can I draw thumbs of this CScrollBar object ? What can I do for that ?
    I attach a little sample project to illustrate the issue ...
    Attached Files Attached Files

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

Featured