C++/CLI - Textbox HideCaret - hide blinking cursor

2019-09-19 16:05发布

问题:

Is there any method to use HideCaret().... or in general, just achieve something like described here:

Prevent Blinking Cursor in Textbox

but in a Managed C++ (clr) ?

回答1:

If you're in C++/CLI, just call HideCaret directly, no need for DllImport.

#include <windows.h>

System::Windows::Forms::TextBox^ textbox1;

HideCaret((HWND)textbox1->Handle.ToPointer());