如何在wpf中制作不可编辑的文本框 [英] how to make non editable textbox in wpf

查看:1584
本文介绍了如何在wpf中制作不可编辑的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf中制作不可编辑的文本框。

当我调试它时必须是一些不可编辑的文本

how to make non editable textbox in wpf.
when i debug it has to be some non editable text

推荐答案

Add 在文本框的xaml中的IsReadOnly =True


使用标签。这就是标签的用途。文本框用于用户输入。
Use a Label. That's what a Label is for. A textbox is for user input.


Prera​​k和Wayne已经很好地回答了您的问题,只是为了补充:



1. 您可以使用WPF中的文本框执行的所有操作 [ ^ ]

2. 仅读取文本框 [ ^ ]



希望你觉得这很有帮助。

一切顺利。
Prerak and Wayne have answered your question very well, just to add to that :

1. Everything you can do with a text box in WPF[^]
2. Read only Text Box[^]

Hope you find this helpful.
All the best.


这篇关于如何在wpf中制作不可编辑的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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