dataGridView设置数据字体格式

来源:互联网 发布:php msgpack unpack 编辑:程序博客网 时间:2024/05/22 09:02
1、用代码实现:
所有行:          dataGridView1.RowsDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Strikeout);            dataGridView1.RowsDefaultCellStyle.ForeColor = Color.Blue;            dataGridView1.RowsDefaultCellStyle.BackColor = Color.Red;选中行            dataGridView1.SelectedRows[0].DefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Strikeout);            dataGridView1.SelectedRows[0].DefaultCellStyle.ForeColor = Color.Blue;            dataGridView1.SelectedRows[0].DefaultCellStyle.BackColor = Color.Red;
2、用VS可视设置界面
	
				
		
原创粉丝点击