无法在扩展RichTextBox中捕获删除键 [英] Can't catch delete key in extended richtextbox

查看:92
本文介绍了无法在扩展RichTextBox中捕获删除键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用.NET框架和VS2008 Express编写一个小型扩展应用程序(在Revit Architecture下运行).我创建了一个使用 Delcan Brennan丰富文本框扩展类的小型编辑器.但是我注意到,当我按Delete键时,键事件会退回到Revit程序,而不是删除文本框中的字符.

我尝试设置表单的KeyPreview属性,并覆盖richTextBoxExtended组件和表单的PreviewKeyDown和KeyDown事件以及IsInputKey,但是我仍然无法使它捕获删除键.我的表单正在非模式运行.

我已经Goggle搜索了此内容,但所有帖子都与应用程序有关,而与扩展无关.我看不出有什么不同.

有人可以指出我的相关教程或资源吗?

I''ve been writing a small extension app (to run under Revit Architecture) using the .NET framework and VS2008 express. I''ve created a small editor that uses Delcan Brennan''s rich textbox Extended class. However I have noticed that when I press the delete key the key event falls back through to the Revit program instead of deleting a character in the textbox.

I''ve tried setting the KeyPreview property of the form and also overriding the PreviewKeyDown and KeyDown events and IsInputKey of the richTextBoxExtended component and form but I still can''t make it catch the delete key. My form is running non-modal.

I''ve Goggle searched this but all the posts are concerning applications and not extensions. I can''t see that making a difference however.

Can someone point me to a tutorial or resource on this?

推荐答案

如果Declan Brennan阻止了对该密钥的处理,您该怎么办?修补代码或将问题报告给Declan :-)…

顺便说一句,正确拼写人的名字,使用复制粘贴来避免输入错误...

—SA
What can you do if Declan Brennan blocked processing of this key? Patch the code or report the problem to Declan :-)…

By the way, spell person''s name correctly, use copy-paste to avoid a mistake…

—SA


这篇关于无法在扩展RichTextBox中捕获删除键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆