Removed unnecessary class and simplified.
This commit is contained in:
parent
a86185e644
commit
e36ea70cd1
4 changed files with 28 additions and 56 deletions
18
LibationWinForms/DataGridViewImageButtonCell.cs
Normal file
18
LibationWinForms/DataGridViewImageButtonCell.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace LibationWinForms
|
||||
{
|
||||
public class DataGridViewImageButtonCell : DataGridViewButtonCell
|
||||
{
|
||||
protected void DrawButtonImage(Graphics graphics, Image image, Rectangle cellBounds)
|
||||
{
|
||||
var w = image.Width;
|
||||
var h = image.Height;
|
||||
var x = cellBounds.Left + (cellBounds.Width - w) / 2;
|
||||
var y = cellBounds.Top + (cellBounds.Height - h) / 2;
|
||||
|
||||
graphics.DrawImage(image, new Rectangle(x, y, w, h));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue