开发者

In StringGrid, goEditing prevents the MouseDown event from firing

开发者 https://www.devze.com 2023-02-03 08:21 出处:网络
In a string grid I turned on goEditing so that the user doesn\'t have to click to get into the editor.

In a string grid I turned on goEditing so that the user doesn't have to click to get into the editor.

Now when they right click then get the pop-up below, rather than my MouseDown event being called.

Is there a way to turn off thi开发者_JAVA技巧s behavior?

In StringGrid, goEditing prevents the MouseDown event from firing


goEditing mode means that the focused grid cell always contains an active edit control. Without goEditing, the edit control is not made visible until the user clicks to enter edit mode.

In goEditing mode, when you right click you're right clicking on the edit control, not on the grid. Consequently the popup menu that results is the edit control's popup menu rather than the grid's popup menu.

If you want to override/replace the edit control's default popup menu with your own, you may be able to do that by either modifying the edit control instance that the grid uses (there's only one edit control instance that is moved around from cell to cell as focus moves) or by specifying your own cell editor type.

I'm sorry I can't be more specific here - it's been more than ten years since I last worked on the innards of the Delphi grid controls.

0

精彩评论

暂无评论...
验证码 换一张
取 消