RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
c#消除datagridview单元格选中边框-创新互联

通过CellPaint事件解决单元格选中边框问题。

我们提供的服务有:成都网站设计、成都做网站、微信公众号开发、网站优化、网站认证、三河ssl等。为近1000家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的三河网站制作公司

public void PaintBackground (

Rectangle clipBounds,

bool cellsPaintSelectionBackground

)

参数:

clipBounds

一个指定要绘制的 DataGridView 区域的 Rectangle。

cellsPaintSelectionBackground

true 用于使用 DataGridViewCell.InheritedStyle 的 SelectionBackColor 属性的颜色绘制指定边界的背景;false 用于使用 DataGridViewCell.InheritedStyle 的 BackColor 属性的颜色绘制指定边界的背景。

public void PaintContent (

Rectangle clipBounds

)

参数

clipBounds

一个指定要绘制的 DataGridView 区域的 Rectangle。

添加DataGridView的CellPaint事件,代码如下:

private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)

{

e.Handled = true;

e.PaintBackground(e.CellBounds, true);

e.PaintContent(e.CellBounds);

}

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章标题:c#消除datagridview单元格选中边框-创新互联
标题网址:http://scyingshan.cn/article/disjgg.html