C#中,如何隐藏TextBox中闪烁的光标?

调用Windows API

1> 将TextBox的TabStop设置为false;

2> 在程序中相应位置加入下列代码

 

 

using System.Runtime.InteropServices;……[DllImport("user32", EntryPoint = "HideCaret")]private static extern bool HideCaret(IntPtr hWnd);……在TextBox的MouseDown事件中添入:HideCaret(((TextBox)sender).Handle);
文章出处:飞诺网(www.diybl.com):http://www.diybl.com/course/3_program/cshapo/csharpjs/20100714/441315.html

posted @ 2012-05-09 22:21  微笑de『MY』  阅读(668)  评论(0编辑  收藏  举报