1
如標題所示。我的代碼不工作,我不知道爲什麼。我查看了其他來源,他們似乎通過代碼建議我正在嘗試做什麼。有人有主意嗎?更改列標題文本DataGridView
我也試過.Columns(0).Name = New Heading Name
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
With DataGridView1
.DefaultCellStyle.SelectionBackColor = Color.DodgerBlue
.DefaultCellStyle.SelectionForeColor = Color.White
.ColumnHeadersDefaultCellStyle.BackColor = Color.DodgerBlue
.ColumnHeadersDefaultCellStyle.BackColor = Color.AntiqueWhite
.DefaultCellStyle.Font = New Font("Calibri", 12, FontStyle.Regular)
.Columns(0).HeaderCell.Value = "Employee ID"
.Columns(1).HeaderCell.Value = "Account Number"
.Columns(2).HeaderCell.Value = "Last Name"
.Columns(3).HeaderCell.Value = "First Name"
.Columns(4).HeaderCell.Value = "Company"
.Columns(5).HeaderCell.Value = "Beginning Date"
.Columns(6).HeaderCell.Value = "Ending Date"
End With
謝謝!
我沒有。我需要添加一個TableStyle到我的網格視圖嗎? –
看到這個答案http://stackoverflow.com/questions/6829570/set-columns-width-in-a-datagrid-using-compact-framework :) –
檢查我的更新 –