private void InvalidateCaret()
{
if(Caret != null) {
Caret.Dispose();
Caret = null;
}
Caret = new Bitmap(CaretSize.Width, CaretSize.Height);
using(Graphics g = Graphics.FromImage(Caret)) {
using(SolidBrush b = new SolidBrush(this.CaretColor)) {
g.FillRectangle(b, new Rectangle(0, 0, Caret.Width, Caret.Height));
}
}
ShowHideCaret();
}