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

  • <small id='2SUVD'></small><noframes id='2SUVD'>

      <tfoot id='2SUVD'></tfoot>

      1. 如何在未聚焦的 WinForms TextBox/RichTextBox 中显示光标?

        How to show cursor in unfocused WinForms TextBox/RichTextBox?(如何在未聚焦的 WinForms TextBox/RichTextBox 中显示光标?)
          <bdo id='vtL4n'></bdo><ul id='vtL4n'></ul>
              <i id='vtL4n'><tr id='vtL4n'><dt id='vtL4n'><q id='vtL4n'><span id='vtL4n'><b id='vtL4n'><form id='vtL4n'><ins id='vtL4n'></ins><ul id='vtL4n'></ul><sub id='vtL4n'></sub></form><legend id='vtL4n'></legend><bdo id='vtL4n'><pre id='vtL4n'><center id='vtL4n'></center></pre></bdo></b><th id='vtL4n'></th></span></q></dt></tr></i><div id='vtL4n'><tfoot id='vtL4n'></tfoot><dl id='vtL4n'><fieldset id='vtL4n'></fieldset></dl></div>

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

              <tfoot id='vtL4n'></tfoot>
                  <tbody id='vtL4n'></tbody>

                  <legend id='vtL4n'><style id='vtL4n'><dir id='vtL4n'><q id='vtL4n'></q></dir></style></legend>
                1. 本文介绍了如何在未聚焦的 WinForms TextBox/RichTextBox 中显示光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要在 WinForms 应用程序的 RichTextBox 控件中显示光标,即使它不在焦点上.我怎样才能做到这一点?我只找到了 WPF 的方法( How to keep WPF TextBox selection什么时候不专注?)

                  I need to show cursor in RichTextBox control in WinForms application even when it's not in focus. How can I do this? I found only the way for WPF ( How to keep WPF TextBox selection when not focused?)

                  推荐答案

                  你可以使用WinAPI ..

                  You can use WinAPI ..

                   [DllImport("user32.dll", EntryPoint = "ShowCaret")]
                   public static extern long ShowCaret(IntPtr hwnd);
                   [DllImport("user32.dll", EntryPoint = "HideCaret")]
                   public static extern long HideCaret(IntPtr hwnd);
                  

                  并随时调用 ShowCaret

                  and call ShowCaret whenever you want

                  这篇关于如何在未聚焦的 WinForms TextBox/RichTextBox 中显示光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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# 纯数字文本框控件)
                          <bdo id='faPwf'></bdo><ul id='faPwf'></ul>
                          <legend id='faPwf'><style id='faPwf'><dir id='faPwf'><q id='faPwf'></q></dir></style></legend>

                            <tbody id='faPwf'></tbody>
                          <tfoot id='faPwf'></tfoot>

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

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