'只读属性设置
dgvStmpDuty.ReadOnly = True
'尾行自动追加
dgvStmpDuty.AllowUserToAddRows = False
'Del键删除设定
dgvStmpDuty.AllowUserToDeleteRows
'行幅自动变化
dgvStmpDuty.AllowUserToResizeRows = False
'高度设定
dgvStmpDuty.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing
'标头设定
dgvStmpDuty.RowHeadersVisible = False
'行选择设定
dgvStmpDuty.SelectionMode = DataGridViewSelectionMode.FullRowSelect
'多行选择
dgvStmpDuty.MultiSelect = False
'选择状态解除
dgvStmpDuty.ClearSelection()
'head文字居中 dgvStmpDuty.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
'选择状态的行的颜色
dgvStmpDuty.DefaultCellStyle.SelectionBackColor = Color.GreenYellow
dgvStmpDuty.DefaultCellStyle.SelectionForeColor = Color.Black
'行副填充时自动调整宽度
dgvStmpDuty.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
dgvStmpDuty.ReadOnly = True
'尾行自动追加
dgvStmpDuty.AllowUserToAddRows = False
'Del键删除设定
dgvStmpDuty.AllowUserToDeleteRows
'行幅自动变化
dgvStmpDuty.AllowUserToResizeRows = False
'高度设定
dgvStmpDuty.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing
'标头设定
dgvStmpDuty.RowHeadersVisible = False
'行选择设定
dgvStmpDuty.SelectionMode = DataGridViewSelectionMode.FullRowSelect
'多行选择
dgvStmpDuty.MultiSelect = False
'选择状态解除
dgvStmpDuty.ClearSelection()
'head文字居中 dgvStmpDuty.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
'选择状态的行的颜色
dgvStmpDuty.DefaultCellStyle.SelectionBackColor = Color.GreenYellow
dgvStmpDuty.DefaultCellStyle.SelectionForeColor = Color.Black
'行副填充时自动调整宽度
dgvStmpDuty.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill