DataGridView怎么设置边框才是单线边框
展开全部
Public Class Form1
'窗体上只需要拉出一个DataGridView,其它什么也不用做
Dim sPen As Pen = New Pen(Color.Black, 1)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.ColumnCount = 6 '6列,也可在设计时添加
DataGridView1.Rows.Add(10) '10行
DataGridView1.RowHeadersVisible = False
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
DataGridView1.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None
DataGridView1.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.None
DataGridView1.GridColor = Color.Red '为了截图,设为红色
sPen.Color = Color.Red
'窗体上只需要拉出一个DataGridView,其它什么也不用做
Dim sPen As Pen = New Pen(Color.Black, 1)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.ColumnCount = 6 '6列,也可在设计时添加
DataGridView1.Rows.Add(10) '10行
DataGridView1.RowHeadersVisible = False
DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
DataGridView1.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None
DataGridView1.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.None
DataGridView1.GridColor = Color.Red '为了截图,设为红色
sPen.Color = Color.Red
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询