如何在使用c#调整datagridview中的行标题时动态更改字体大小?

时间:2015-01-20 07:05:54

标签: c# datagridview

我希望在datagridview中调整行标题时动态更改字体大小。

1 个答案:

答案 0 :(得分:1)

 private void dataGridView1_RowHeightChanged(object sender, DataGridViewRowEventArgs e)
    {
        float width =e.Row.Height-3;
        dataGridView1.RowsDefaultCellStyle.Font = new Font("Arial", width, GraphicsUnit.Pixel);              
    }

在浮动宽度= e.Row.Height-3中,无论你想要什么,3都是你的价值......我认为这很有用....