In StringGrid, goEditing prevents the MouseDown event from firing
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?
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.
精彩评论