DataGridViewButtonColumn按钮样式 [英] DataGridViewButtonColumn button style

查看:1354
本文介绍了DataGridViewButtonColumn按钮样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在创建datagridview以显示图像列表.
在datagridview中,我正在显示大小为100X100像素的图像缩略图.
在每一行中,我要添加按钮删除.为此,我使用DataGridViewButtonColumn.

问题在于按钮看起来像不是标准按钮.首先,它将填充所有单元格内容.这可以通过底部和顶部填充调整来解决.
第二个问题是按钮是白色的.变回原色会更改按钮和背景的颜色.

有人可以帮我解决这个问题吗?

Hello,
I''m creating datagridview to display list of images.
In datagridview i''m showing image thumbnails of size 100X100 pixel.
In each row i would like to add button remove. For this i use DataGridViewButtonColumn.

Problem is that button looks like not a standard button. First of all it fills all cell content. This can be fixed with bottom and top padding adjustments.
Second problem is that button is white. Changing back color changes color for button and for background.

Can someone help me with this problem?

推荐答案

更改datagridviewbutton对象的背景颜色不是很简单.对您有一些帮助:
http://bluefenix.net/blog/archive/2007/12/13/datagridview_colorpicker_using_a_datagridviewbuttoncolumn.aspx [ ^ ]
Changing the back color of datagridviewbutton object is not a straight forward one..I found an article on this..may be of some help to you:
http://bluefenix.net/blog/archive/2007/12/13/datagridview_colorpicker_using_a_datagridviewbuttoncolumn.aspx[^]


您好

您可以在datagridview中使用任何类型的按钮,但必须有"CommandName",因为使用CommandName可以编写用于添加,删除,更新的代码
Hello

you can use any kind of button with datagridview but there must be "CommandName" because using CommandName you can write code for add,delete,update


这篇关于DataGridViewButtonColumn按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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