How invoke standard contextual menu vs custom

I have a few custom contextual menu options in my listbox for managing rows.

Capture

I’d like to have the regular cut, copy, and paste for when a cell is in edit mode, but I don’t want two sets of cut, copy, and paste in the menu.

Is there a way to switch to the default contextual menu (the one that pops up by default when right clicking in textfields) when a cell is in edit mode?

Capture2

Don’t populate the menu and return false. It should give you the default behavior.

Thanks! Just returning false resulted in no contextual menu. However, I was able to use your suggestion to do this, and it worked fine.

if me.ColumnTypeAt(0)=DesktopListbox.CellTypes.TextField then
  
  base.AddMenu EditUndo.Clone
  base.AddMenu(New MenuItem(MenuItem.TextSeparator))
  base.AddMenu EditCut.Clone
  base.AddMenu EditCopy.Clone
  base.AddMenu EditPaste.Clone
  base.AddMenu EditClear.Clone
  base.AddMenu(New MenuItem(MenuItem.TextSeparator))
  base.AddMenu EditSelectAll.Clone
  
  Return False
  
END

base.AddMenu(New MenuItem("Edit"))
base.AddMenu(New MenuItem(MenuItem.TextSeparator))
base.AddMenu(New MenuItem("Cut"))
base.AddMenu(New MenuItem("Copy"))
base.AddMenu(New MenuItem("Paste"))
base.AddMenu(New MenuItem("Delete"))
base.AddMenu(New MenuItem("Duplicate"))
base.AddMenu(New MenuItem(MenuItem.TextSeparator))
base.AddMenu(New MenuItem("Move Up"))
base.AddMenu(New MenuItem("Move Down"))
base.AddMenu(New MenuItem("Comment Out"))



Return True

Now, that being said, I wasn’t making the whole column editable before, just the cell, so I had to add code to turn the whole column editable in order for this to work. I wasn’t able to figure out the condition for this at a row level. I tried many things, but the syntax was never right. For my own edification, what is the “row” equivalent of:

if me.ColumnTypeAt(0)=DesktopListbox.CellTypes.TextField then

Thanks!!!

You should be returning True to prevent any system menu from appearing.

I am returning true. Scroll to the bottom of that code snippet. :slight_smile: