解决DataGridView1组件不能完全居中的问题

VB.NET · 04-04 · 133 人浏览
        Me.DataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter

    For i As Integer = 0 To DataGridView1.Columns.Count - 1
        Me.DataGridView1.Columns(i).SortMode = DataGridViewColumnSortMode.NotSortable
    Next