How to make a textbox non-selectable using C#

前端 未结 11 1913
轮回少年
轮回少年 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:04

    You have a couple of options:

    1. Use a Label control instead.
    2. Set textBox.Enabled = false to prevent selection (see here).

提交回复
热议问题