将图像添加到vb.net中的datagridview image coloumn [英] Adding image to datagridview image coloumn in vb.net

查看:85
本文介绍了将图像添加到vb.net中的datagridview image coloumn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试将图像添加到datagridview的image列,使用以下代码但它返回错误(system.argumentexception:参数无效)



Hi,
I am trying to add image to the image column of datagridview, using the following code but it returns an error (system.argumentexception: Parameter is not valid)

ofdLogoImage.ShowDialog()
vrPicHolder = IO.File.ReadAllBytes(ofdLogoImage.FileName)
dgvLogo.Item(3, dgvLogo.Rows.Count - 1).Value = vrPicHolder





请指教。

谢谢!



Please advise.
Thanks!

推荐答案

确保ofdLogoImage.FileName指的是图像的正确和完整路径。无效的路径或文件名会重现上述错误。
Make sure "ofdLogoImage.FileName" refers to a correct and full path of an image. Invalid path or filename reproduces the above error.


这篇关于将图像添加到vb.net中的datagridview image coloumn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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