<i id='MKaGk'><tr id='MKaGk'><dt id='MKaGk'><q id='MKaGk'><span id='MKaGk'><b id='MKaGk'><form id='MKaGk'><ins id='MKaGk'></ins><ul id='MKaGk'></ul><sub id='MKaGk'></sub></form><legend id='MKaGk'></legend><bdo id='MKaGk'><pre id='MKaGk'><center id='MKaGk'></center></pre></bdo></b><th id='MKaGk'></th></span></q></dt></tr></i><div id='MKaGk'><tfoot id='MKaGk'></tfoot><dl id='MKaGk'><fieldset id='MKaGk'></fieldset></dl></div>

<small id='MKaGk'></small><noframes id='MKaGk'>

      <legend id='MKaGk'><style id='MKaGk'><dir id='MKaGk'><q id='MKaGk'></q></dir></style></legend>

          <bdo id='MKaGk'></bdo><ul id='MKaGk'></ul>

      1. <tfoot id='MKaGk'></tfoot>
      2. C#中的只读文本框

        Read-only textbox in C#(C#中的只读文本框)

        1. <small id='SqT2R'></small><noframes id='SqT2R'>

              <bdo id='SqT2R'></bdo><ul id='SqT2R'></ul>
                <i id='SqT2R'><tr id='SqT2R'><dt id='SqT2R'><q id='SqT2R'><span id='SqT2R'><b id='SqT2R'><form id='SqT2R'><ins id='SqT2R'></ins><ul id='SqT2R'></ul><sub id='SqT2R'></sub></form><legend id='SqT2R'></legend><bdo id='SqT2R'><pre id='SqT2R'><center id='SqT2R'></center></pre></bdo></b><th id='SqT2R'></th></span></q></dt></tr></i><div id='SqT2R'><tfoot id='SqT2R'></tfoot><dl id='SqT2R'><fieldset id='SqT2R'></fieldset></dl></div>
                <tfoot id='SqT2R'></tfoot>

                <legend id='SqT2R'><style id='SqT2R'><dir id='SqT2R'><q id='SqT2R'></q></dir></style></legend>

                  <tbody id='SqT2R'></tbody>
                  本文介绍了C#中的只读文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 C# 中,我正在为 LAN Messenger 创建一个表单窗口有两个文本框.我需要创建一个只读的特定文本框,但提交给它的任何文本都显示为灰色,这是不可取的.有什么办法可以预防吗?

                  In C#, I am creating a form window for a LAN messenger with two textboxes. I need to create a particular textbox as read-only, but any text submitted to it is appearing grey which is not desirable. Is there any way that can be prevented?

                  推荐答案

                  我会使用文本框并将 ReadOnly 设置为 true,将 ForeColor 设置为 Color.Black,将 BackColor 设置为 Color.White.这样您仍然可以选择文本并使用 Ctrl-C 进行复制.

                  I would use a Textbox and set ReadOnly to true, ForeColor to Color.Black, and BackColor to Color.White. This way you can still select the text and copy it with Ctrl-C.

                  这篇关于C#中的只读文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to keep the Text of a Read only TextBox after PostBack()?(PostBack()之后如何保留只读文本框的文本?)
                  Winforms Textbox - Using Ctrl-Backspace to Delete Whole Word(Winforms 文本框 - 使用 Ctrl-Backspace 删除整个单词)
                  C# - Add button click events using code(C# - 使用代码添加按钮单击事件)
                  Multi-color TextBox C#(多色文本框 C#)
                  How can i set the caret position to a specific index in passwordbox in WPF(如何将插入符号位置设置为 WPF 密码框中的特定索引)
                  C# Numeric Only TextBox Control(C# 纯数字文本框控件)
                • <i id='qJo7c'><tr id='qJo7c'><dt id='qJo7c'><q id='qJo7c'><span id='qJo7c'><b id='qJo7c'><form id='qJo7c'><ins id='qJo7c'></ins><ul id='qJo7c'></ul><sub id='qJo7c'></sub></form><legend id='qJo7c'></legend><bdo id='qJo7c'><pre id='qJo7c'><center id='qJo7c'></center></pre></bdo></b><th id='qJo7c'></th></span></q></dt></tr></i><div id='qJo7c'><tfoot id='qJo7c'></tfoot><dl id='qJo7c'><fieldset id='qJo7c'></fieldset></dl></div>

                    <small id='qJo7c'></small><noframes id='qJo7c'>

                      • <bdo id='qJo7c'></bdo><ul id='qJo7c'></ul>

                          1. <legend id='qJo7c'><style id='qJo7c'><dir id='qJo7c'><q id='qJo7c'></q></dir></style></legend>
                              <tbody id='qJo7c'></tbody>
                            <tfoot id='qJo7c'></tfoot>