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

            foreach (ToolButton tool in tools)
            {
                PaintLibrary.Button(e, tool.Bounds.Location, tool.Bounds.Size, tool.Text, highlightedButton == tool);
            }
        }
示例#2
0
        protected override void OnPaint(WinForms.PaintEventArgs pe)
        {
            if (this.Size.Height != 22)
            {
                this.Size = new Size(this.Size.Width, 22);
            }

            PaintLibrary.Box(pe, this.Size, "", true);
        }
示例#3
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);
            }
        }
示例#4
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);
        }
示例#5
0
        protected override void CalculateBounds(System.Windows.Forms.PaintEventArgs e)
        {
            if (tools.Count == 1)
            {
                PaintLibrary.Button(e, new Point(0, 0), Size, this.Text, highlightedButton == tools[0]);
            }
            else if (tools.Count > 1)
            {
                const int PADDING = 4;

                Size  size     = new Size((Size.Width / tools.Count) - PADDING, Size.Height);
                Point location = new Point(0, 0);

                foreach (ToolButton tool in tools)
                {
                    tool.Bounds = new Rectangle(location, size);
                    location.X += PADDING + size.Width;
                }
            }
        }
示例#6
0
 protected override void OnPaint(WinForms.PaintEventArgs pe)
 {
     PaintLibrary.Box(pe, this.Size, string.Empty, true);
     base.OnPaint(pe);
 }
示例#7
0
 protected override void OnPaint(System.Windows.Forms.PaintEventArgs pe)
 {
     base.OnPaint(pe);
     PaintLibrary.Button(pe, new Point(0, 0), this.Size, this.Text, false);
 }