How to disable cursor in textbox?

后端 未结 10 1084
执笔经年
执笔经年 2020-12-09 02:41

Is there any way to disable cursor in textbox without setting property Enable to false? I was trying to use ReadOnly property but despite the fact that I can\'t write in tex

10条回答
  •  Happy的楠姐
    2020-12-09 03:14

    You could use a Label instead. When in the designer, you set BorderStyle = Fixed3D, BackColor = Window and AutoSize = False, it looks a lot like a TextBox.

    However, the cursor in a TextBox is provided so that the user can scroll through the text when it is longer than the box. You'll lose that functionality with a Label, unless you are sure that it will always fit. Other than that, it is not possible to remove the cursor from a TextBox.

提交回复
热议问题