更新时间:2023-12-03 11:52:46
也许您可以重载Cell Paint事件并手动加载图像并绘制文本?
Perhaps you could overload the Cell Paint event and manually load the image and draw the text?
paint事件为您提供了一个Graphics 对象,它具有用于此类事物的DrawString()方法。像这样的东西;假设Column2是DataGridViewImageColumn
the paint event gives you a Graphics object which has DrawString() methods for such things. Something like this; assuming Column2 is a DataGridViewImageColumn
using (Brush br = Brushes.Black)
{
Column2.Image = Image.FromFile(@"c:\tmp\capture.png");
e.Graphics.DrawString("Something.", this.Font, br, e.CellBounds);
}