Custom Caret for WinForms TextBox

前端 未结 4 582
暗喜
暗喜 2020-11-30 09:43

I\'m developing a custom HyperTerminal like application in a WinForms .Net 2.0 application. I have a multiline TextBox in a Panel in which you can interact with a hardware

4条回答
  •  醉梦人生
    2020-11-30 09:51

    These are the list of Native Caret functions provided by Windows you can use them for you application.

        [DllImport("User32.dll")]
        static extern bool CreateCaret(IntPtr hWnd, int hBitmap, int nWidth, int nHeight);
    
        [DllImport("User32.dll")]
        static extern bool SetCaretPos(int x, int y);
    
        [DllImport("User32.dll")]
        static extern bool DestroyCaret();
    
        [DllImport("User32.dll")]
        static extern bool ShowCaret(IntPtr hWnd);
    
        [DllImport("User32.dll")]
        static extern bool HideCaret(IntPtr hWnd);
    

    Refer SharpDevelop, Source Code @ src\Libraries\ICSharpCode.TextEditor\Project\Src\Gui\Caret.cs

提交回复
热议问题