首页 > 其他 > 详细

设置DdtaGridView控件中网格线的样式

时间:2018-12-31 19:37:31      阅读:247      评论:0      收藏:0      [点我收藏+]

实现效果:

  技术分享图片

知识运用:

  DataGridView控件的GridColor属性    //用来获取或设置网格线的颜色

  public Color GridColor { get; set; }  //属性值: Color对象或  SystemColors对象

 实现代码:

        private void Form1_Load(object sender, EventArgs e)
        {
            dataGridView1.GridColor = Color.Red;
            dataGridView1.DataSource = new List<Student>()
            {
                new Student(){Age=21,Name="小敏"},
                new Student(){Age=33,Name="老臣"},
                new Student(){Age=24,Name="小峰"},
                new Student(){Age=22,Name="张嘎"},
                new Student(){Age=21,Name="半胖"}
            };
            dataGridView1.Columns[0].Width = 150;
            dataGridView1.Columns[1].Width = 150;
        }

 

设置DdtaGridView控件中网格线的样式

原文:https://www.cnblogs.com/feiyucha/p/10203069.html

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