为什么嵌入的表单不响应箭头键?

时间:2021-02-22 17:23:29

I am building a simple plugin framework in Delphi (XE) where the plugins are forms than can be optionally embedded into a TabSheet on a main application. There are examples on the web that explain how to do the embedding, for example: http://delphi.about.com/od/adptips2005/a/bltip0305_5.htm. I have tried this myself and it appears successful. However I find that if I put a TMemo on the embedded form, the arrow keys do not work on the embedded TMemo, ie the cursor on the TMemo will not move. Other keys such as backspace, delete, Ctrl-V etc and alphanumeric keys work as expected (The TAB will not traverse the controls in the embedded form either). A TMemo on the main application works fine. Any idea why the TMemo in the embedded form will not respond to the arrow keys?

我正在Delphi(XE)中构建一个简单的插件框架,其中插件是表单,而不是可选地嵌入到主应用程序的TabSheet中。网上有一些例子可以解释如何进行嵌入,例如:http://delphi.about.com/od/adptips2005/a/bltip0305_5.htm。我自己尝试过,看起来很成功。但是我发现如果我在嵌入的表单上放置一个TMemo,箭头键对嵌入的TMemo不起作用,即TMemo上的光标不会移动。其他键,如退格键,删除键,Ctrl-V键和字母数字键按预期工作(TAB也不会遍历嵌入表单中的控件)。主应用程序上的TMemo工作正常。知道为什么嵌入式表格中的TMemo不会响应箭头键吗?

2 个解决方案

#1


0  

I in counter the same way before and i use the Form.Preview := True to inherit the key activity to make it global. try to see this example it be useful for you.

我之前以同样的方式使用Form.Preview:= True来继承关键活动以使其成为全局。试着看看这个例子对你有用。

#2


0  

The problem lies with the plugin system I build (which remains to be identified) not with the embedding itself.

问题在于我构建的插件系统(仍有待识别)而不是嵌入本身。

#1


0  

I in counter the same way before and i use the Form.Preview := True to inherit the key activity to make it global. try to see this example it be useful for you.

我之前以同样的方式使用Form.Preview:= True来继承关键活动以使其成为全局。试着看看这个例子对你有用。

#2


0  

The problem lies with the plugin system I build (which remains to be identified) not with the embedding itself.

问题在于我构建的插件系统(仍有待识别)而不是嵌入本身。