本文介绍了如何避免“开放式IME"?在StringGrid中弹出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在StringGrid中,有时我右键单击时会在下面看到不需要的菜单.这是Windows弹出窗口吗?
In a StringGrid, sometimes I get the unwanted menu below when I right-click. Is this a Windows popup?
如何防止出现此弹出窗口而不是我自己的弹出窗口?
How to I prevent this popup from appearing rather than my own?
我的选项中有goAlwaysShowEditor.
I have goAlwaysShowEditor in my Options.
我已经将StringGrid.PopupMenu设置为弹出窗口.
I have set StringGrid.PopupMenu to my popup.
如果右键单击,我将StringGrid.OnMouseDown设置为显示我的弹出窗口.
I've set StringGrid.OnMouseDown to show my popup if it's a right click.
推荐答案
您可以像这样覆盖虚拟的 CreateEditor
方法(尽管这不是一个好的解决方案,但我知道:-):
You can override the virtual CreateEditor
method like this way (not a good solution though, I know :-):
type
TStringGrid = class(Grids.TStringGrid)
protected
function CreateEditor: TInplaceEdit; override;
end;
implementation
function TStringGrid.CreateEditor: TInplaceEdit;
begin
Result := inherited CreateEditor;
TMaskEdit(Result).PopupMenu := Form1.PopupMenu1;
end;
这篇关于如何避免“开放式IME"?在StringGrid中弹出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!