Exemple #1
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            this.CalculateBounds(e);

            foreach (ListItem item in this.items)
            {
                Rectangle area = new Rectangle(item.Bounds.Location, item.Bounds.Size);
                PaintLibrary.Label(e, area, item.Text, new Font("Arial", 14), StringAlignment.Near, StringAlignment.Center, Color.Black, this.highlightedItem == item);
            }
        }
Exemple #2
0
        protected override void OnPaint(WinForms.PaintEventArgs pe)
        {
            if (this.Size.Height != 22)
            {
                this.Size = new Size(this.Size.Width, 22);
            }

            base.OnPaint(pe);

            Rectangle area = new Rectangle(0, 0, this.Size.Width, this.Size.Height);

            PaintLibrary.Label(pe, area, this.Text, new Font("Arial", 14), StringAlignment.Center, StringAlignment.Center, Color.Black, false);
        }