正文

CListCtrl滚动条的一些问题搜集2009-10-16 11:33:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/yuqiexing/49319.html

分享到:

(1)ICON形式中,如果设置属性中对齐方式为LVS_ALIGNTOP,那么当内容容纳不下时,只会出现竖直滚动条(Vertical Scroll)

(2)ICON形式中,如果设置属性中对齐方式为LVS_ALIGNLEFT,那么当内容容纳不下时,只会出现水平滚动条(Vertical Scroll)

(3)Report形式中,当行容纳不下时,出现竖直滚动条;当列容纳不下时,出现水平滚动条

有些时候,如果要强烈禁止出现水平滚动条或者竖直滚动条,那么可以用下面的方法:

void CThumbnailViewList::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp)
{
 // TODO: Add your message handler code here and/or call default
 ModifyStyle(WS_HSCROLL,0);   // 强烈禁止
 ShowScrollBar(SB_VERT,1);     //  强烈打开
 CListCtrl::OnNcCalcSize(bCalcValidRects, lpncsp);
}

例如有人碰到这样的问题:

Hello. I'm working with a CListCtrl on a property sheet, and am having a problem with window sizing and the scroll bars.When my list grows enough to need a vertical scroll, the window space taken by the vertical scroll causes the Control to also create a horizontal scroll. This works fine, but I'm wondering if there is a way to prevent the horizontal scroll from being there. I'd rather not have the horizontal scroll present at all.


他遇到的问题是:本来Report形式的列数是可以不需要水平滚动条的,但是由于竖直滚动条的出现,导致右边间距增大,从而也导致了水平滚动条的出现。

专家解答如下:

try this:
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20874814.html

不过我还没试验过,下次有机会试验一下。

 

阅读(8120) | 评论(4)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

loading...
您需要登录后才能评论,请 登录 或者 注册