C#

[C#]TextBox Caret Hide 예제

선영아 사랑해 2018. 4. 20. 10:57

텍스트박스의 캐럿 비활성화 예제이오니 개발 시 참고하세요...



using System.Runtime.InteropServices;


[DllImport("user32.dll")]
static extern bool HideCaret(IntPtr hWnd);


private void Form_Load(object sender, EventArgs e)
{

         textBox1.GotFocus += new EventHandler(textBox1_GotFocus);

}


private void textBox1_GotFocus(object sender, EventArgs e)

{

       HideCaret(textBox1.Handle);

}