Private Sub AddButtonColumn()
Dim buttons As New DataGridViewButtonColumn()
With buttons
.HeaderText = "Sales"
.Text = "Sales"
.UseColumnTextForButtonValue = True
.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells
.FlatStyle = FlatStyle.Standard
.CellTemplate.Style.BackColor = Color.Honeydew
.DisplayIndex = 0
End With
DataGridView1.Columns.Add(buttons)
End Sub
沒有留言:
張貼留言