• <tfoot id='DHLse'></tfoot>

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

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

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

        文本框中的中间按钮滚动的东西

        middle-button scrolly thing in textbox(文本框中的中间按钮滚动的东西)

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

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

              <tbody id='AVkkN'></tbody>

                <tfoot id='AVkkN'></tfoot>
                • 本文介绍了文本框中的中间按钮滚动的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的应用程序中有一个多行文本框,当我中键单击向上或向下滚动时,它不起作用.

                  i have a multiline textbox in my app and when i middle-click to scroll up or down, it doesn't work.

                  它在记事本中有效,但在我的文本框中无效.有人知道为什么吗?或者,是否可以在单击中间按钮时以编程方式开始向所需方向滚动?

                  It works in Notepad, but not in my textbox. Does anybody know why? or, if it is possible to programatically begin scrolling in the desired direction when the middle-button's clicked?

                  推荐答案

                  要让鼠标滚轮滚动工作,请创建您自己的继承 TextBox 的自定义 TextBox 类.

                  To get the mouse wheel scroll thing to work, make your own custom TextBox class that inherits TextBox.

                  重写 WndProc 方法.

                  Override the WndProc method.

                  查看消息类型.

                  对于消息类型 0x207 (WM_MBUTTONDOWN),调用 DefWndProc(ref m);对于任何其他消息类型,调用 base.WndProc(ref m);

                  For Message type 0x207 (WM_MBUTTONDOWN), call DefWndProc(ref m); For any other message type, call base.WndProc(ref m);

                  然后你的文本框会有中间按钮滚动.

                  Then your text box will have middle button scroll.

                  通常 Windows.Forms 会覆盖文本框的内置中间按钮功能,因此控件可以在中间按钮上有一个 MouseDown 事件,但这也会禁用固有的滚动功能.返回调用默认窗口处理程序,文本框恢复其滚动功能.

                  Normally Windows.Forms overrides the built-in middle button feature of the textbox so the control can have a MouseDown event on the middle button, but that also disables the innate scroll feature. Go back to calling the default window handler, and the textbox gets its scroll feature back.

                  这篇关于文本框中的中间按钮滚动的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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='rlnmv'><tr id='rlnmv'><dt id='rlnmv'><q id='rlnmv'><span id='rlnmv'><b id='rlnmv'><form id='rlnmv'><ins id='rlnmv'></ins><ul id='rlnmv'></ul><sub id='rlnmv'></sub></form><legend id='rlnmv'></legend><bdo id='rlnmv'><pre id='rlnmv'><center id='rlnmv'></center></pre></bdo></b><th id='rlnmv'></th></span></q></dt></tr></i><div id='rlnmv'><tfoot id='rlnmv'></tfoot><dl id='rlnmv'><fieldset id='rlnmv'></fieldset></dl></div>
                  <legend id='rlnmv'><style id='rlnmv'><dir id='rlnmv'><q id='rlnmv'></q></dir></style></legend>

                • <tfoot id='rlnmv'></tfoot>

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

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

                              <tbody id='rlnmv'></tbody>