One direction you may want to use is to initialize all or most of the DGV(s) used in your application by passing the DGV reference var to a shared sub. This will give each DGV a consistent look and state.
Public Shared Sub InitGrid(ByRef dg As DataGridView)
dg.Columns.Clear()
Dim altcolor As Color = Color.FromArgb(215, 215, 255)
Dim cellFont As Font = New Font("Arial", 8)
Dim headerFont As Font = New Font("Arial", 8)
Dim headerCellFont As New Font("Arial", 8, FontStyle.Underline)
dg.AutoGenerateColumns = False
dg.AllowUserToAddRows = False
dg.AllowUserToDeleteRows = False
dg.ReadOnly = True
dg.AlternatingRowsDefaultCellStyle.BackColor = altcolor
dg.ColumnHeadersDefaultCellStyle.Font = headerFont
dg.RowsDefaultCellStyle.Font = cellFont
dg.RowHeadersWidth = 17
dg.EnableHeadersVisualStyles = False
dg.RowTemplate.Height = 22
dg.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing
dg.ColumnHeadersHeight = 22
dg.ColumnHeadersDefaultCellStyle.BackColor = Color.LightYellow
End Sub
regs.
ron O.