Exemplo n.º 1
0
        private void Construct()
        {
            rowHeight = 18;

            //base.BackColor = SystemColors.Window;

            SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.ResizeRedraw|
                ControlStyles.Opaque|ControlStyles.UserPaint|ControlStyles.DoubleBuffer|
                ControlStyles.Selectable|ControlStyles.UserMouse, true);

            this.BackColor = SystemColors.Window;

            columns = new ExtendedListView.Forms.ColumnHeaderCollection();
            items = new ContainerListViewItemCollection();
            selectedIndices = new ArrayList();
            selectedItems = new ContainerListViewItemCollection();

            hscrollBar = new HScrollBar();
            hscrollBar.Parent = this;
            hscrollBar.Minimum = 0;
            hscrollBar.Maximum = 0;
            hscrollBar.SmallChange = 10;
            hscrollBar.Hide();

            vscrollBar = new VScrollBar();
            vscrollBar.Parent = this;
            vscrollBar.Minimum = 0;
            vscrollBar.Maximum = 0;
            vscrollBar.SmallChange = rowHeight;
            vscrollBar.Hide();

            Attach();

            GenerateColumnRects();
            GenerateHeaderRect();
        }
Exemplo n.º 2
0
		/// <summary>
		/// Initializes a new instance of the OwnerDrawnList class with default values.
		/// </summary>
		public OwnerDrawnList()
		{
			listItems = new ArrayList();
			//Create a ScrollBar instance
			vScroll = new VScrollBar();
			//Hide it for now
			vScroll.Hide();
			//Hookup into its ValueChanged event
			vScroll.ValueChanged+=new EventHandler(vScrollcroll_ValueChanged);
			//Add Scrollbar
			vScroll.Value = 0;

			this.Controls.Add(vScroll);
			
			SCROLL_WIDTH = vScroll.Width;

			itemWidth = this.Width;

			origHeight = this.Height;

			this.BackColor = Color.Red;
		}