Пример #1
0
        protected override void OnRenderTabScrollChevron(TabStripScrollButtonRenderEventArgs e)
        {
            const int ChevronWidth  = 8;
            const int ChevronHeight = 5;

            Pen pen = Pens.Black;

            try
            {
                int x = e.ChevronRectangle.Left + ((e.ChevronRectangle.Width - ChevronWidth) / 2);
                int y = e.ChevronRectangle.Top + ((e.ChevronRectangle.Height - ChevronHeight) / 2);

                bool left = (e.ScrollDirection == TabStripScrollDirection.Left) &&
                            (e.ToolStrip.RightToLeft == RightToLeft.No);

                if (e.ToolStrip.RightToLeft == RightToLeft.Yes)
                {
                    left = (e.ScrollDirection == TabStripScrollDirection.Right);
                }

                if (left)
                {
                    x += 2;
                }

                if (!e.Item.Enabled)
                {
                    pen = new Pen(Color.FromArgb(178, 178, 178), 1);
                }

                for (int i = 0; i < ChevronHeight; i++, y++)
                {
                    e.Graphics.DrawLine(pen, x, y,
                                        x + 1, y);

                    e.Graphics.DrawLine(pen, x + 4, y,
                                        x + 4 + 1, y);

                    if (i < (ChevronHeight / 2))
                    {
                        x += (left) ? -1 : +1;
                    }
                    else
                    {
                        x += (left) ? +1 : -1;
                    }
                }
            }
            finally
            {
                if (!e.Item.Enabled)
                {
                    pen.Dispose();
                }
            }
        }
Пример #2
0
        public void DrawTabScrollChevron(TabStripScrollButtonRenderEventArgs e)
        {
            OnRenderTabScrollChevron(e);

            var handler = Events[EventRenderTabScrollChevron] as EventHandler <TabStripScrollButtonRenderEventArgs>;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (Renderer != null)
            {
                var chevronRect = new Rectangle(
                    new Point(Padding.Left, Padding.Top),
                    new Size(Width - Padding.Horizontal, Height - Padding.Vertical));

                var args = new TabStripScrollButtonRenderEventArgs(e.Graphics, this, chevronRect);

                Renderer.DrawTabScrollChevron(args);
            }
        }
Пример #4
0
 protected virtual void OnRenderTabScrollChevron(TabStripScrollButtonRenderEventArgs e)
 {
 }