109,886
社区成员




private void demoGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (demoGrid.Columns[e.ColumnIndex].Name.Equals("Image"))
{
string path = System.Windows.Forms.Application.StartupPath + @"/1.gif";
e.Value = GetImage(path);
}
}
public System.Drawing.Image GetImage(string path)
{
System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Open);
System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
fs.Close();
return result;
}