备忘一下
[DllImport("user32", EntryPoint = "HideCaret")]
//禁止焦点
private static extern bool HideCaret(IntPtr hWnd);
private void richTextBox1_MouseEnter(object sender, EventArgs e)
{
HideCaret(this.richTextBox1.Handle);
}
private void richTextBox1_MouseDown(object sender, MouseEventArgs e)
{
HideCaret(this.richTextBox1.Handle);
}