Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 检测datagridview图像列是否具有默认图像_Vb.net_Datagridview_Vb.net 2010 - Fatal编程技术网

Vb.net 检测datagridview图像列是否具有默认图像

Vb.net 检测datagridview图像列是否具有默认图像,vb.net,datagridview,vb.net-2010,Vb.net,Datagridview,Vb.net 2010,我有一个带有图像列的datagridview,此列的空值在设计器中自动设置为System.Drawing.Bitmap 现在,从后面的代码中,我需要检查该列是显示默认图像还是其他图像,以便在picturebox中显示它 为此,我尝试使用以下代码 If Not dgImageList.CurrentRow.Cells("img1").Value Is Nothing Then pctBox.BackgroundImage = dgImageList.CurrentRow.Cells("img1")

我有一个带有图像列的datagridview,此列的空值在设计器中自动设置为
System.Drawing.Bitmap

现在,从后面的代码中,我需要检查该列是显示默认图像还是其他图像,以便在picturebox中显示它

为此,我尝试使用以下代码

If Not dgImageList.CurrentRow.Cells("img1").Value Is Nothing Then pctBox.BackgroundImage = dgImageList.CurrentRow.Cells("img1").Value

我建议您使用另一列来执行该比较。任何布尔属性(例如:“返回图像为空”)、图片名称或类似的内容

因为如果我理解了你的问题,你的标题可能是“比较两幅图像”。那么,没有什么可以“改造”: