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

            var borderPen = new Pen(GlassStyleManager.Active.BorderColor);

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

            borderPen.Dispose();
        }
        public GlassPanel()
        {
            this.SetStyle ( ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.Opaque , true);

            this.gradient = new GlassGradient( Color.FromArgb( 96,96,96 ), Color.FromArgb( 0,0,0 ) );
            this.borders = GlassBorders.All;
        }
Exemple #3
0
        public GlassPanel()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint |
                     ControlStyles.Opaque, true);

            gradient = new GlassGradient(Color.FromArgb(96, 96, 96), Color.FromArgb(0, 0, 0));
            borders  = GlassBorders.All;
        }
        public static void DrawBorder( Rectangle rectangle, GlassBorders borders, Graphics graphics )
        {
            if ( rectangle.Width == 0 || rectangle.Height == 0 )
                return;

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

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

            borderPen.Dispose();
        }