实现效果:

  设置DataGridView单元格的文本对齐方式

知识运用:

  DataGridViewCellStyle类的Alignment属性      //获取或设置DataGridView单元格内的单元格内容的位置

  public DataGridViewContentAlignment Alignment {get; set;} //  设置控件列的DefaultCellStyle.Alignment属性来完成

  设置DataGridView单元格的文本对齐方式

实现代码:

dataGridView1.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

 

相关文章:

  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2021-10-18
  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2021-08-20
相关资源
相似解决方案