protected override Rectangle GetContentBounds (Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
{
if (DataGridView == null)
return Rectangle.Empty;
object o = FormattedValue;
Size s = Size.Empty;
if (o != null) {
s = DataGridViewCell.MeasureTextSize (graphics, o.ToString (), cellStyle.Font, TextFormatFlags.Default);
s.Height += 2;
}
return new Rectangle (0, (OwningRow.Height - s.Height) / 2, s.Width, s.Height);
}