Disable contextual menu on TextField

Is there a way to stop the standard contextual menu of a TextField from showing up?

I made my own menu, but without the automatically added “Copy, Cut, Paste, etc” items.
But after selecting on of the items of my own menu, the menu closes, to make room for the system’s contextual menu.

I tried several things, including call base.close in the ConstructContextualMenu event. But I figure that that’s not the way of stopping it from showing up.
Any ideas?

What version of Xojo are you using? EditField hasn’t been used since RS 2009.
What platform are you seeing this on?

On Mac using a TextField, if I supply items to the base MenuItem the system contextual menu does not appear.

in MouseDown:

If IsContextualClick Then return true End If

My bad… I meant the TextField. I work on a Mac, last OS-X and use Xojo 16 R4.1

When I add items to the base MenuItem the system’s items still append.
I will try Axel’s suggestion, first thing tomorrow.

(Challenging the flu here. So I’m taking it easy for a while)

Because I’m not seeing that here on Mac.

As I mentioned, I work on a mac.
And this is what I see:

I have a simple panel containing several property fields for some media related project.

When I right-click the language field a popup menu opens.

But when I select a language the system’s contextual menu opens.

I think this problem can be solved using Axel’s solution.

When I right-click the file field the actual ContextualMenu is being constructed with three items.

But underneath these items some weird stuff is being appended.

The thing is, Axel’s solution works. But I still find it weird that the System appends stuff to the base Menuitem.

I believe the second menu is the Edit menu. It is probably the normal behavior, after selecting text.

The language field is editable in this example. The final product will have it set to read-only, of course… that explains the “Cut, Copy and Paste” items being added. The file field is read-only.

In the file field, I used the ConstructContextualMenu event.
In the language field, I use the MouseDown event. I added the IsContextualClick value to see if I right clicked.
I created my own menu which I opened using the menu.PopUp method.
I check the result of that method to see the item I clicked.
I finished the MouseDown event with Return True (like Axel suggested). That actually helped.

So, I think I will change all my fields of all the property panels to use the MouseDown event.

But still, it puzzles me that stuff is being added in the base MenuItem, of the ConstructContextualMenu event. Not that I will go for that solution anymore. But it would be nice to have some basic editing option like “Cut, Copy and Paste” on fields with user-editable fields, like a name field. But of course, I can code those items into my own menus, if I need them.
Of course, a Popup-Control will help. But I don’t like the look of it in my UI-design.

Actually, you do not need to create anything for edition, it is the default behavior. When text is selected, you get automatically the Edit menu.

It just would be nice to be in control of what is shown.

If there is a EditMenu in the Window Menu the shortcuts work even (“Cut, Copy and Paste”) if you use Return True in MouseDown