CheckedListBoxControl 或CheckedListBox 控件中显示水平滚动条 z

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            DisplayHScroll();
        }
        /// 
        /// 获取或设置一个值,该值指示是否在控件中显示水平滚动条
        /// 
        private void DisplayHScroll()
        {
            checkedListBox1.IntegralHeight = true;
            for (int x = 0; x < 10; x++)
            {
                checkedListBox1.Items.Add("Item  " + x.ToString() + " is a very large value that requires scroll bars");
            }
            checkedListBox1.HorizontalScrollbar=true;
        }
    }

运行结果如下图:

CheckedListBoxControl 或CheckedListBox 控件中显示水平滚动条 z_第1张图片

参考: http://msdn.microsoft.com/zh-cn/library/system.windows.forms.checkedlistbox.aspx

参考:http://msdn.microsoft.com/zh-cn/library/system.windows.forms.listbox.horizontalscrollbar.aspx

转载于:https://www.cnblogs.com/zeroone/p/4311231.html

你可能感兴趣的:(CheckedListBoxControl 或CheckedListBox 控件中显示水平滚动条 z)