- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要检测用户是否将剪贴板中的文本粘贴到 ToolStripTextBox 中。因此,我创建了一个继承自 ToolStripTextBox 的自定义控件。然后我想覆盖 WndProc 以捕获 WM_PASTE 消息,但我注意到没有要覆盖的 WndProc。对于标准 TextBox,所描述的方法工作正常。
有什么建议可以检测 ToolStripTextBox 上剪贴板中的粘贴吗?
最佳答案
ToolStripTextBox
中的
WndProc
似乎遥不可及。出于好奇,我搜索了一下并找到了答案 - https://stackoverflow.com/a/4688745/168719
如果使用 ToolStripControlHost
不是一个选项,对于需要自定义处理 WndProc 的场景还有其他聪明的解决方案:
http://bytes.com/topic/c-sharp/answers/279168-toolstriptextbox-right-click
Nicholas Paldino [.NET/C# MVP]
I just noticed that. In order to get around this, you can get the hosted TextBox by calling the TextBox property. Then, you should be able to create a class derived from NativeWindow which overrides the WndProc method to ignore the context menu message [or to intercept WM_PASTE, obviously...] When you get the textbox property, get the handle, and assign the handle to your overridden NativeWindow class.
关于c# - 在 ToolStripTextBox (C#) 中检测来自剪贴板的粘贴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11846130/
在 WinForms 项目中,我知道如何添加 placeholder text到一个普通的文本框。但 ToolStripTextBox 似乎不是常规文本框。其一,它不公开句柄(这是通过 Win API
我非常喜欢 ToolStripProfessionalRenderer 样式,但我不喜欢它呈现 ToolStripTextBox 的方式。在这里,ToolStripSystemRenderer 在 I
我需要延迟检索 ToolStripTextBox 的 TextChanged 事件,以便在停止按键 x 秒后做一些事情.. 我为 TextBox 找到了这个(并且有效)示例。 https://www.
在 C# Winforms 应用程序中,我使用“toolStripTextBox”工具条控件来捕获一些文本,这些文本将用于过滤表单上的其他一些内容。 “toolStripTextBox”是从“tool
我认为,我的问题源于这样一个事实,即 TextBox 是 IBindableComponent,而 ToolStripTextBox 不是。 我正在寻找与 ToolStripTextBox 进行简单绑
我需要检测用户是否将剪贴板中的文本粘贴到 ToolStripTextBox 中。因此,我创建了一个继承自 ToolStripTextBox 的自定义控件。然后我想覆盖 WndProc 以捕获 WM_P
在 C# - WinForms 中,如何检测在 ToolStripTextBox 中按下 Alt + 左键? 最佳答案 protected override bool ProcessCmdKe
我有一个 ToolStripTextBox(它的名称是 SearchBox),我希望在用户键入内容并按下回车键后将它们带到一个 URL。我已经整理好 URL 部分,但我需要知道之后会发生什么 Hand
我是一名优秀的程序员,十分优秀!