How to make a textbox non-selectable using C#

前端 未结 11 1871
轮回少年
轮回少年 2021-02-19 11:09

I\'m using C#/.NET for a Windows Forms application. I have a text box. How can I make the text box unselectable?

I don\'t want to disable the complete textbox.

11条回答
  •  -上瘾入骨i
    2021-02-19 11:47

    IsHitTestVisible="False" prevents the textbox from displaying the bounding box when hovering or clicking with the mouse. That was enough in my case to take benefit of the textwrapping feature of the textbox while making it insensitive to user actions

提交回复
热议问题