?禁用txtbox而不显示字体? [英] ?disable txtbox without graying out font?

查看:58
本文介绍了?禁用txtbox而不显示字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


所以我想在vb.net表单上禁用一个文本框

而不会使文本变灰。在vb6中我可以在一个帧控件上放置

a文本框控件并禁用框架

启用文本框并且文本/背景完好无损但是b $ b完好但是鼠标光标仍然是一个arraw(而不是

我是可编辑的)。我在.net

表单上尝试了一个Panel控件,因为我可以猜测不再有一个框架

控件(也试过了一个groupbox控件)。我禁用了这些

容器控件,但在面板中,文本框得到了灰色的
。使用groupbox,文本框仍然可以编辑。任何建议都赞赏如何禁用

文本框而不会让它变灰。


谢谢,

Rich

解决方案

我只是想了想。带有3d边框的标签有点

看起来像文本框。这就是.net现在这样做了吗?

只是检查。

-----原帖-----
你好,

所以我想在vb.net表单上禁用文本框
而不会使文本变灰。在vb6中我可以在帧控件上使用
placea文本框控件并禁用
frameleaving启用文本框并且文本/背景完好无损但鼠标光标仍然是一个arraw(而不是
我是可编辑的)。我在.net
表单上尝试了一个Panel控件,因为我可以猜测不再有一个框架
控件(也试过了一个groupbox控件)。我禁用了这些
容器控件,但在面板中,文本框显示为灰色。使用groupbox,文本框仍然可以编辑。任何建议都明白如何禁用
文本框而​​不会让它变灰。

谢谢,
Rich



在VB 6.0中,您需要做的就是将锁定属性更改为true

(不是启用属性,导致文本变灰)。


在.NET中,您只需将ReadOnly属性更改为true。

" Rich" <一个******* @ discussions.microsoft.com>在消息中写道

news:26 **************************** @ phx.gbl ... < blockquote class =post_quotes>你好,

所以我想禁用vb.net表单上的文本框
而不会使文本变灰。在vb6中,我可以在框架控件上放置一个文本框控件并禁用框架
保持文本框启用,文本/背景完好无损但鼠标光标仍然是一个箭头(而不是表单上尝试了一个Panel控件,因为我可以猜测不再有一个框架
控件(也试过了一个groupbox控件)。我禁用了这些
容器控件,但在面板中,文本框显示为灰色。使用groupbox,文本框仍然可以编辑。任何建议都明白如何禁用
文本框而​​不会让它变灰。

感谢,
Rich





? "丰富" <一个******* @ discussions.microsoft.com> ?????? ??? ??????

新闻:26 **************************** @ phx.gbl。 ..

你好,

所以我想在vb.net表单上禁用文本框
而不会使文本变灰。在vb6中,我可以在框架控件上放置一个文本框控件并禁用框架
保持文本框启用,文本/背景完好无损但鼠标光标仍然是一个箭头(而不是表单上尝试了一个Panel控件,因为我可以猜测不再有一个框架
控件(也试过了一个groupbox控件)。我禁用了这些
容器控件,但在面板中,文本框显示为灰色。使用groupbox,文本框仍然可以编辑。任何建议都赞赏如何禁用
文本框而​​不会让它变灰。

谢谢,
Rich




你好!

将文本框的''enabled''属性设置为false

后,您可以将背景颜色更改为web-> white。您可以随时使用带有白色背景色的简单

标签。 Fixed3D BorderStyle。


Hello,

So I would like to disable a textbox on a vb.net form
without the text getting grayed out. In vb6 I could place
a textbox control on a frame control and disable the frame
leaving the textbox enabled and text/background were
intact but mouse cursor remained an arraw (as opposed to
an I for editable). I tried a Panel control on my .net
form since I could I guess there is no longer a frame
control (also tried a groupbox control). I disable these
container controls, but in the panel the textbox got
grayed out. With groupbox, the textbox was still
editable. Any suggestions appreciated how to disable
textbox without graying it out.

Thanks,
Rich

解决方案

I just had a thought. A lable with a 3d border kinda
looks like a textbox. Is this the way .net does it now?
Just checking.

-----Original Message-----
Hello,

So I would like to disable a textbox on a vb.net form
without the text getting grayed out. In vb6 I could placea textbox control on a frame control and disable the frameleaving the textbox enabled and text/background were
intact but mouse cursor remained an arraw (as opposed to
an I for editable). I tried a Panel control on my .net
form since I could I guess there is no longer a frame
control (also tried a groupbox control). I disable these
container controls, but in the panel the textbox got
grayed out. With groupbox, the textbox was still
editable. Any suggestions appreciated how to disable
textbox without graying it out.

Thanks,
Rich
.



In VB 6.0, all you needed to do what changed the locked property to true
(not the enabled property, which caused the text to gray out).

In .NET, you just change the ReadOnly property to true.
"Rich" <an*******@discussions.microsoft.com> wrote in message
news:26****************************@phx.gbl...

Hello,

So I would like to disable a textbox on a vb.net form
without the text getting grayed out. In vb6 I could place
a textbox control on a frame control and disable the frame
leaving the textbox enabled and text/background were
intact but mouse cursor remained an arraw (as opposed to
an I for editable). I tried a Panel control on my .net
form since I could I guess there is no longer a frame
control (also tried a groupbox control). I disable these
container controls, but in the panel the textbox got
grayed out. With groupbox, the textbox was still
editable. Any suggestions appreciated how to disable
textbox without graying it out.

Thanks,
Rich




? "Rich" <an*******@discussions.microsoft.com> ?????? ??? ??????
news:26****************************@phx.gbl...

Hello,

So I would like to disable a textbox on a vb.net form
without the text getting grayed out. In vb6 I could place
a textbox control on a frame control and disable the frame
leaving the textbox enabled and text/background were
intact but mouse cursor remained an arraw (as opposed to
an I for editable). I tried a Panel control on my .net
form since I could I guess there is no longer a frame
control (also tried a groupbox control). I disable these
container controls, but in the panel the textbox got
grayed out. With groupbox, the textbox was still
editable. Any suggestions appreciated how to disable
textbox without graying it out.

Thanks,
Rich



Hi Rich!
After you set the ''enabled'' property of the textbox to false
you can change the backcolor to web->white. You can always use a simple
label with white backcolor & Fixed3D BorderStyle.


这篇关于?禁用txtbox而不显示字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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