WinForm 窗体继承WeifenLuo.WinFormsUI.DockContent
此窗体中有DataGridView控件 ,其中第一列是图片列:
在窗体加载时代码如下:
foreach (DataGridViewRow row in this.DGV)
{
row.Cells[0].Value = Image.FromFile(path + "tmp.gif");
}问题:
第一列中不能显示出图片(图片路径绝对正确)。
但是再窗体加载完,在别的事件中就能加载图片。有做过的吗? 知道为什么吗? 是不是WeifenLuo.WinFormsUI.DockContent 控件的问题?
此窗体中有DataGridView控件 ,其中第一列是图片列:
在窗体加载时代码如下:
foreach (DataGridViewRow row in this.DGV)
{
row.Cells[0].Value = Image.FromFile(path + "tmp.gif");
}问题:
第一列中不能显示出图片(图片路径绝对正确)。
但是再窗体加载完,在别的事件中就能加载图片。有做过的吗? 知道为什么吗? 是不是WeifenLuo.WinFormsUI.DockContent 控件的问题?
{
// 执行绑定数据的代码
this.customersTableAdapter.Fill(this.northwindDataSet.Customers); //..... foreach (DataGridViewRow row in dataGridView1.Rows )
{
row.Cells[0].Value = Image.FromFile("F:/Temp/204q.jpg");
} }