开发者

Using Bold font for setting a Datagrid forecolor

How do I make the font of a forecolor bold when I use this below code dg.ForeColor = System.Drawing.Color.Black; How do I mak开发者_如何学Ce it bold?

Thanks, pooja


You can use this code (which you can also find in the 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;


Something like

dataGridView1.Font = new Font("Arial",8.5F , FontStyle.Bold);


i think this post answers your question:

How to make row in gridview bold and regular programatically

cheers:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜