using System.Runtime.InteropServices; [DllImport("USER32", EntryPoint = "HideCaret")] private static extern bool HideCaret(IntPtr hWnd);
//获得焦点事件时隐藏光标 TB.GotFocus += new EventHandler(TB_GotFocus); void TB_GotFocus(object sender, EventArgs e) { HideCaret((sender as Control).Handle); }