kennedymr2
Programmer
I have a form with 3 datagridView's ie DataGridView1 DataGridView2 etc
With DataGridView1
.GridColor = Color.Red
.CellBorderStyle = DataGridViewCellBorderStyle.None
.BackgroundColor = Color.LightGray
'.DefaultCellStyle.SelectionBackColor = Color.Red
.DefaultCellStyle.SelectionForeColor = Color.Yellow
.DefaultCellStyle.WrapMode = DataGridViewTriState.[True]
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
.AllowUserToResizeColumns = False
.RowsDefaultCellStyle.BackColor = Color.Bisque
.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige
end with
With DataGridView2
.as above
end with
With DataGridView3
.as above
end with
>>???? is there a way of looping through without having to duplicate the code for each datagridview
eg
for ll= 1 to 3
if ll=1 then
with datagridview1
endif
if ll=2 then
with datagridview2
endif
etc
next ll
Appreciate any advice
Kennedymr2