增加窗体边框3D效果

 /// <summary>
        /// 增加窗体边框3D效果
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            using (Pen bluePen = new Pen(Color.FromArgb(141, 178, 196)))
            {
                e.Graphics.DrawLine(bluePen, 1, 1, this.Width - 2, 1);
                e.Graphics.DrawLine(bluePen, 1, 1, 1, this.Height - 2);
                e.Graphics.DrawLine(bluePen, 1, this.Height - 2, this.Width - 2, this.Height - 2);
                e.Graphics.DrawLine(bluePen, this.Width - 2, 1, this.Width - 2, this.Height - 2);
            }
        }

 

posted @ 2015-11-04 11:12  哈哈好玩  阅读(432)  评论(0编辑  收藏  举报