CListCtrl滚动条的一些问题搜集

(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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值