我希望在datagridview中调整行标题时动态更改字体大小。
答案 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都是你的价值......我认为这很有用....