使用粗体字体设置Datagrid前景色

当我使用下面的代码时,如何使forecolor字体变为粗体 dg.ForeColor = System.Drawing.Color.Black; 如何使它变得大胆? 谢谢, POOJA     
已邀请:
您可以使用此代码(您也可以在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;
    
就像是
dataGridView1.Font = new Font("Arial",8.5F , FontStyle.Bold);
    
我认为这篇文章回答了你的问题: 如何在gridview中使用粗体和常规编程行 干杯:)     

要回复问题请先登录注册