示例#1
0
        public static void DrawBorder(Rectangle rectangle, MetalBorders borders, Graphics graphics)
        {
            if (rectangle.Width == 0 || rectangle.Height == 0)
            {
                return;
            }

            Pen borderPen = new Pen(MetalStyleManager.Active.BorderColor);

            if ((borders & MetalBorders.Left) > 0)
            {
                graphics.DrawLine(borderPen, 0, 0, 0, rectangle.Height - 1);
            }
            if ((borders & MetalBorders.Top) > 0)
            {
                graphics.DrawLine(borderPen, 0, 0, rectangle.Width - 1, 0);
            }
            if ((borders & MetalBorders.Right) > 0)
            {
                graphics.DrawLine(borderPen, rectangle.Width - 1, 0, rectangle.Width - 1, rectangle.Height - 1);
            }
            if ((borders & MetalBorders.Bottom) > 0)
            {
                graphics.DrawLine(borderPen, 0, rectangle.Height - 1, rectangle.Width - 1, rectangle.Height - 1);
            }

            borderPen.Dispose();
        }
示例#2
0
        public MetalPanel()
        {
            this.SetStyle ( ControlStyles.DoubleBuffer |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.Opaque , true);

            this.gradient = new MetalGradient( Color.FromArgb( 96,96,96 ), Color.FromArgb( 0,0,0 ) );
            this.borders = MetalBorders.All;
        }
示例#3
0
        public MetalPanel()
        {
            this.SetStyle(ControlStyles.DoubleBuffer |
                          ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.UserPaint |
                          ControlStyles.Opaque, true);

            this.gradient = new MetalGradient(Color.FromArgb(96, 96, 96), Color.FromArgb(0, 0, 0));
            this.borders  = MetalBorders.All;
        }
示例#4
0
        public static void DrawBorder( Rectangle rectangle, MetalBorders borders, Graphics graphics )
        {
            if ( rectangle.Width == 0 || rectangle.Height == 0 )
                return;

            Pen borderPen = new Pen( MetalStyleManager.Active.BorderColor );

            if ( (borders & MetalBorders.Left) > 0 )
                graphics.DrawLine( borderPen, 0, 0, 0, rectangle.Height - 1 );
            if ( (borders & MetalBorders.Top) > 0 )
                graphics.DrawLine( borderPen, 0, 0, rectangle.Width - 1, 0 );
            if ( (borders & MetalBorders.Right) > 0 )
                graphics.DrawLine( borderPen, rectangle.Width - 1, 0, rectangle.Width - 1, rectangle.Height - 1 );
            if ( (borders & MetalBorders.Bottom) > 0 )
                graphics.DrawLine( borderPen, 0, rectangle.Height - 1, rectangle.Width - 1, rectangle.Height - 1 );

            borderPen.Dispose();
        }