Drawing a blinking caret in Winforms

后端 未结 1 1463
刺人心
刺人心 2021-01-15 22:33

I\'m developing a custom control, which most resembles a text area. I am drawing text, which works correctly, and accepting input which also works.. But I (the user) am left

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-15 23:10

    I think that, annoyingly, there is no managed API for Carets. You must, therefore, either PInvoke to the Win32 functions for carets, or, implement that functionality yourself (i.e. painting and hiding a blinking caret, when and only when your control has the input focus).

    See Custom Caret for WinForms TextBox for example.

    0 讨论(0)
提交回复
热议问题