■■■

2016年4月1日金曜日

DataGridViewの背景色を一行おきに設定する方法

DataGridViewの背景色を一行おきに設定する方法
1.全体の色を設定する
2.奇数行のみ色を設定する
VB.NET
dgv1.RowsDefaultCellStyle.BackColor = Color.Aqua
dgv1.AlternatingRowsDefaultCellStyle.BackColor = Color.Yellow
C#
dgv1.RowsDefaultCellStyle.BackColor = Color.Aqua;
dgv1.AlternatingRowsDefaultCellStyle.BackColor = Color.Yellow;
















■■■