日期:2014-05-18  浏览次数:21331 次

如何去掉ListView控件的水平滚动条
当我在使用ListView控件的时候,我想使用它的垂直滚动条,不想使用水平滚动条,

可是这个控件只有一个属性Scrollable,

当我把它设置为true的时候,垂直滚动条和水平滚动条都显示了

设置为false的时候,2个滚动条都没有了

有什么办法可以实现只显示水平滚动条不显示垂直滚动条

------解决方案--------------------
http://topic.csdn.net/t/20031104/11/2425014.html
------解决方案--------------------
C# code

public class SubWindow : NativeWindow
    {
        [DllImport("user32.dll")]
        public static extern int ShowScrollBar(IntPtr hWnd, int iBar, int bShow);

        const int SB_HORZ = 0;
        const int SB_VERT = 1;

        protected override void WndProc(ref Message m)
        {
            ShowScrollBar(m.HWnd, SB_HORZ, 0);
            base.WndProc(ref m);
        }
    }