dataGridView背景颜色 [英] dataGridView background color

查看:139
本文介绍了dataGridView背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使datagridview背景透明.
我表格的背景是图片.
我收到无效属性的错误.

How can i make datagridview background as transparent.
Background of my form is an image.
i am getting an error that invalid property.

推荐答案

据我所知,没有标准方法可以执行此操作,您需要对DataGridView进行子类化并采用自己画画.
您还需要将所有列的背景色设置为透明.

看到这样的答案:将datagrid视图背景设置为透明 [ ^ ].
正如答案所提到的,它是缩进图像背景的,但是可以更改为使用父背景颜色.

祝你好运.
As far as I could find there is not standard way to do this, you will need to subclass the DataGridView and take care of the painting yourself.
You also need to set the background colour of all columns to transparent.

See this SO answer: Set datagrid view background to transparent[^].
As the answer mentions it is indented for an image background, but can be changed to use the parent background colour.

Good luck.


尝试关注
GridView1.BackColor = Color.Transparent

希望对您有所帮助.
Try following
GridView1.BackColor = Color.Transparent

Hope this should help.


这篇关于dataGridView背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆