【发布时间】:2014-08-27 05:54:13
【问题描述】:
有谁知道如何让按钮一直可见?(不仅在单元格的编辑模式下) 我想请你注意这个问题的答案。 how to add ellipse button and textbox in current cell of datagridview in winforms
我可以增强此解决方案以始终查看单元格中的按钮控件。我想要的是获得第一次单击单元格的弹出框。这是在未编辑模式下绘制按钮的代码。
// Finally paint the NumericUpDown control
Rectangle srcRect = new Rectangle(0, 0, valBounds.Width, valBounds.Height);
if (srcRect.Width > 0 && srcRect.Height > 0)
{
Bitmap renderingBitmap = new Bitmap(22, 18);
new TextButton().button.DrawToBitmap(renderingBitmap, srcRect);
graphics.DrawImage(renderingBitmap, new Rectangle(new Point(cellBounds.X+cellBounds.Width-24, valBounds.Location.Y-2), valBounds.Size),
srcRect, GraphicsUnit.Pixel);
}
【问题讨论】:
标签: winforms datagridview