In a text box, how can I prevent the blinking cursor from appearing when I click on it?
I read on some forums that there is a call to a specific api, but when I tried it in my code, an error was shown. Please provide the full code for this purpose, if possible, and let me know if there is a specific event in which the code should be executed.
This text box is part of the form window that is created to model lan messenger. I am using C #. The form has two text fields to resemble google words. It would be desirable to prevent the blinking cursor from appearing in the upper text box.
I tried:
[DllImport("user32")] private static extern bool HideCaret(IntPtr hWnd); public void HideCaret() { HideCaret(TextBox1.Handle); }
I get an error: "DllImport not found."
c # winforms textbox
Avik
source share