当我使用下面的代码时,如何使前景色的字体变粗 dg.ForeColor = System.Drawing.Color.Black; 我如何将其设为粗体?
谢谢, 礼拜
最佳答案
您可以使用此代码(也可以在 designer.cs 中找到):
var dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle1;
关于c# - 使用粗体字体设置 Datagrid 前景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5014671/