datagridview列标题居中显示

DataGridViewCellStyle headerStyle = new DataGridViewCellStyle();

headerStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;

this.dataGridView1.ColumnHeadersDefaultCellStyle = headerStyle;

你可能感兴趣的:(winform)