VB.net GridView,通过代码添加图像 [英] VB.net GridView , Adding images by code

查看:70
本文介绍了VB.net GridView,通过代码添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,
请帮我在VB.net Windows应用程序中填充Gridview,逐行填充,因为连接到数据库的数据集填充对我不起作用,因为我有很多图像文件路径,并且不需要存储在数据库中,我有3列,其中2列是文本,其中1列是图片框,因此我必须在该图片框中填写图像的路径,请帮助,
感谢您的答复.

Dears,
Please help me to fill a Gridview in VB.net windows application , to fill it row by row , Filling by a Dataset which is connected to a database will not work with me , because I have many images files paths , and no need to store it in a database , I have three column , 2 of them are text , and one of them is picture box , so I have to fill the path of the image in that picture box , Please help ,
I appreciate your response

推荐答案

首先使用Visual Studio的编辑列"对话框将DataGridView控件的图像"列的列类型设置为图像".之后,当您将图像设置为其值时,它将显示图像
First Set the Column Type of Image Column of Your DataGridView Control to "Image" Using Edit Column Dialog of Visual Studio. After that It Display Images when you set Image as it''s Value
' For Instance I've Use Column1 (Array Index 0) to Display Images.
Me.DataGridView1.Rows(0).Cells(0).Value = System.Drawing.Image.FromFile _
("C:\Images\Image1.jpg")


这篇关于VB.net GridView,通过代码添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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