gpt4 book ai didi

delphi - 如何避免 StringGrid 中出现 "Open IME"弹出窗口?

转载 作者:行者123 更新时间:2023-12-03 15:17:13 25 4
gpt4 key购买 nike

在 StringGrid 中,有时右键单击时会出现下面不需要的菜单。这是 Windows 弹出窗口吗?

popup screen capture

如何防止出现此弹出窗口而不是我自己的弹出窗口?

我的选项中有 goAlwaysShowEditor。

我已将 StringGrid.PopupMenu 设置为我的弹出窗口。

我已设置 StringGrid.OnMouseDown 以在右键单击时显示我的弹出窗口。

最佳答案

您可以像这样重写虚拟 CreateEditor 方法(尽管这不是一个好的解决方案,我知道:-):

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;

关于delphi - 如何避免 StringGrid 中出现 "Open IME"弹出窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10676691/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com