private void ShowHideCaret()
{
if(Caret == null) {
InvalidateCaret();
}
IntPtr handle = IntPtr.Zero;
if(this.InvokeRequired) {
handle = (IntPtr)this.Invoke(new GetControlHandleDelegate(this.GetControlHandle), this.richTextBoxConsole);
} else {
handle = GetControlHandle(this.richTextBoxConsole);
}
Imports.HideCaret(handle);
Imports.CreateCaret(handle, this.Caret.GetHbitmap(), CaretSize.Width, CaretSize.Height);
Imports.ShowCaret(handle);
}