首页 > Windows开发 > 详细

C# 修改GroupBox的边框颜色和字体颜色

时间:2015-12-22 16:06:28      阅读:1248      评论:0      收藏:0      [点我收藏+]

改变GroupBox边框和的颜色

        private void groupBox_BasicInformation_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.Clear(this.groupBox_BasicInformation.BackColor);
            e.Graphics.DrawString(this.groupBox_BasicInformation.Text, this.groupBox_BasicInformation.Font, Brushes.Red, 10, 1);
            e.Graphics.DrawLine(Pens.Red, 1, 7, 8, 7);
            e.Graphics.DrawLine(Pens.Red, e.Graphics.MeasureString(this.groupBox_BasicInformation.Text, this.groupBox_BasicInformation.Font).Width + 8, 7, this.groupBox_BasicInformation.Width - 2, 7);
            e.Graphics.DrawLine(Pens.Red, 1, 7, 1, this.groupBox_BasicInformation.Height - 2);
            e.Graphics.DrawLine(Pens.Red, 1, this.groupBox_BasicInformation.Height - 2, this.groupBox_BasicInformation.Width - 2, this.groupBox_BasicInformation.Height - 2);
            e.Graphics.DrawLine(Pens.Red, this.groupBox_BasicInformation.Width - 2, 7, this.groupBox_BasicInformation.Width - 2, this.groupBox_BasicInformation.Height - 2); 
        }

 

C# 修改GroupBox的边框颜色和字体颜色

原文:http://www.cnblogs.com/AmatVictorialCuram/p/5066629.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!