Vb.net 检测datagridview图像列是否具有默认图像
我有一个带有图像列的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")
System.Drawing.Bitmap
现在,从后面的代码中,我需要检查该列是显示默认图像还是其他图像,以便在picturebox中显示它
为此,我尝试使用以下代码
If Not dgImageList.CurrentRow.Cells("img1").Value Is Nothing Then pctBox.BackgroundImage = dgImageList.CurrentRow.Cells("img1").Value
我建议您使用另一列来执行该比较。任何布尔属性(例如:“返回图像为空”)、图片名称或类似的内容 因为如果我理解了你的问题,你的标题可能是“比较两幅图像”。那么,没有什么可以“改造”: