如何在win窗体中超链接到DataGridViewImageColumn?
OPs评论的代码示例:
DataGridView dgv = new DataGridView();
dgv.Name = "dgv" + i;
dgv.DataSource = dsMain.Tables[0];
dgv.Dock = DockStyle.Fill;
dgv.AllowUserToAddRows = false;
DataGridViewImageColumn img = new DataGridViewImageColumn();
Image image = Image.FromFile("C:\\Small.jpg");
img.Image = image;
img.ImageLayout = DataGridViewImageCellLayout.Normal;
dgv.Columns.Add(img);
img.HeaderText = "";
img.Name = "img";
tp.Controls.Add(dgv);
答案 0 :(得分:0)
您希望链接做什么?打开网页?
只需在图片中添加点击处理程序。