有劳各路英雄了,我就是想用我自己加的滚动条来控制lisctrl的滚动,就这么简单,怎老是没人理我呀,恳请大家给个面子吧,小弟感谢不尽!谢谢

解决方案 »

  1.   

    try to override CWnd::GetScrollBarCtrl , return your customized scroll bar control
      

  2.   

    http://msdn.microsoft.com/msdnmag/issues/01/11/c/Q 
    I have read your Q&A columns on using WM_CTLCOLOR to change a control color in MFC, but still I cannot change the scroll bar color in my MFC AppWizard-generated program. I override OnCtlColor in my CScrollView and I return an HBRUSH with the desired color, but nothing happens. Can you help?Nasser HosseiniyarA 
    The problem is that Windows has two kinds of scroll bars. There are the "built-in" scroll bars that you get when you use the WS_HSCROLL and/or WS_VSCROLL window styles, and there are scroll bar controls, actual child windows you can create within a window. Only the latter send WM_CTLCOLOR messages. Figure 1 and Figure 2 illustrate this situation. Figure 1 shows a Spy listing of my ImgView program from last month's column.