我想在我的表格中“画”斑马线
不是桌子,只是线条
黑色
白色
黑色
白色
可以导入背景图片,但我更喜欢代码 :)
TextBox1.Text = 80
If IsNumeric(TextBox1.Text) Then
Dim color As Integer = 1
Dim top As Integer = 10
Dim LineNum As Integer = Integer.Parse(TextBox1.Text)
For i = 0 To LineNum
Dim line As New Panel
line.Width = 300
line.Height = 40
If color = 1 Then
color = 0
line.BackColor = Drawing.Color.Black
Else
color = 1
line.BackColor = Drawing.Color.White
End If
top = top + 40
line.Top = top
Me.Controls.Add(line)
Next
End If
;)
用于 datagridview VB.NET 的斑马
DataGridView1.GridColor = Color.Blue
DataGridView1.DefaultCellStyle.ForeColor = Color.Black
DataGridView1.RowsDefaultCellStyle.BackColor = Color.Red
DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Yellow
DataGridView1.GridColor = Color.Silver