如何禁用文本光标? [英] How to disable cursor in textbox?

查看:113
本文介绍了如何禁用文本光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在文本框中取消光标没有设置属性启用以假的?
我试图用只读属性,但尽管我不能写文本,如果我点击文本框光标出现。那么,有没有办法摆脱这种光标permamently?

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 textbox, the cursor appears if I click the textbox. So is there any way to get rid of this cursor permamently?

推荐答案

您可以使用标签来代替。当设计师,将边框= Fixed3D 背景色=窗口自动调整大小=假,它看起来很像一个文本框。

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.

然而,在TextBox光标提供使用户可以通过文本时滚动它比框更长。你会失去功能与标签,除非你确定它会永远适合。除此之外,它不可能从一个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.

这篇关于如何禁用文本光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆