增加窗体边框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);
            }
        }
原文地址:https://www.cnblogs.com/yomho/p/4935373.html