Example #1
0
        public ListView()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.UpdateStyles();

            pListItems = new ListViewItemCollection();
            pListItems.EntriesCleared += new EventHandler(ListItems_EntriesCleared);
            pListItems.EntryAdded     += new EventHandler(ListItems_EntryAdded);
            pListItems.EntryRemoved   += new EventHandler(ListItems_EntryRemoved);
            pListItems.EntryChanged   += new ListViewItemCollection.EntryChangedHandler(pListItems_EntryChanged);

            pListItems.SubEntryAdded   += new ListViewItemCollection.EntryChangedHandler(pListItems_SubEntryAdded);
            pListItems.SubEntryRemoved += new ListViewItemCollection.EntryChangedHandler(pListItems_SubEntryRemoved);
            pListItems.SubItemsCleared += new ListViewItemCollection.EntryChangedHandler(pListItems_SubItemsCleared);

            this.Paint  += new PaintEventHandler(List_Paint);
            this.Resize += new EventHandler(List_Resize);

            HeaderBar.Changed += new ListHeader.ChangeHandler(HeaderBar_Changed);

            BorderColor = Color.FromArgb(152, 152, 152);
            BorderPen   = new Pen(BorderColor);

            pSelectedIndex   = -1;
            RowSelectedColor = Color.FromArgb(213, 218, 244);

            RowColor1 = Color.FromArgb(255, 255, 255);
            RowColor2 = Color.FromArgb(245, 245, 245);

            pFontSize = 9;
            pFont     = FontVault.GetFontVault().GetFont(FontVault.AvailableFonts.MyriadPro, pFontSize);
            TextBrush = new SolidBrush(Color.Black);

            UpdateLayout();
            base.List_Resize(this, EventArgs.Empty);

            this.BackColor = Color.White;
        }
Example #2
0
        public ListBox()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.UpdateStyles();

            this.Paint          += new PaintEventHandler(List_Paint);
            this.Resize         += new EventHandler(List_Resize);
            ListScroller.Scroll += new ScrollEventHandler(ListScroller_Scroll);

            BorderColor = Color.FromArgb(152, 152, 152);
            BorderPen   = new Pen(BorderColor);

            pSelectedIndex   = -1;
            RowSelectedColor = Color.FromArgb(213, 218, 244);

            RowColor2 = Color.FromArgb(255, 255, 255);
            RowColor1 = Color.FromArgb(245, 245, 245);

            pFontSize = 9;
            pFont     = FontVault.GetFontVault().GetFont(FontVault.AvailableFonts.MyriadPro, pFontSize);
            TextBrush = new SolidBrush(Color.Black);

            pListItems = new ListViewItemCollection();
            ListRows   = new DoubleQueue <ListRow>();

            pListItems.EntriesCleared += new EventHandler(ListItems_EntriesCleared);
            pListItems.EntryAdded     += new EventHandler(ListItems_EntryAdded);
            pListItems.EntryChanged   += new ListViewItemCollection.EntryChangedHandler(ListItems_EntryChanged);
            pListItems.EntryRemoved   += new EventHandler(ListItems_EntryRemoved);

            ListScroller.Visible = false;
            bLayoutUpdating      = false;

            this.BackColor = Color.White;

            UpdateLayout();
        }