只读文本框不允许菜单项快捷方式
我有一个只读的文本框。我还有一个工具条菜单项,其快捷方式为 Ctrl + R。当焦点位于文本框中时,工具条菜单项快捷方式不再起作用。
我可以与按键按下事件相交并检查该键是否为 Ctrl + R,但由于我使用的是通用文本框控件,因此这需要引发事件或传递委托来调用通用控件的给定特定键。
如果焦点位于只读控件上,是否有人有过触发工具提示菜单项快捷方式的经验?
I have a text box which is read only. I also have a tool strip menu item which has a short cut of Ctrl + R. When the focus is in the textbox the toolstrip menuitem shortcut no longer works.
I can intersect the key down event and check if the key was Ctrl + R, but since I am using a generic text box control, this would take raising an event or passing a delegate to call given specific keys to my generic control.
Does anyone have any experience getting a toolstip menuitem's shortcut to fire if the focus is on a read only control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将该逻辑放在包含只读控件的窗体上。
Put that logic on the form that contains the read-only control.