How to make a textbox non-selectable using C#

前端 未结 11 1918
轮回少年
轮回少年 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条回答
  •  余生分开走
    2021-02-19 12:05

    Probably the best way is to put a label behind it, and when you want to make the textbox disabled, hide it and show the label in its place.

提交回复
热议问题