Add contextual menu to subclass control

I made a subclass of textField called myTextField.
I want to add a contectual menu to it for editing eg. cut, copy, paste, select all etc.

It won’t work using this method because the item does not exist.

base.Append(EditCut)
base.Append(EditCopy)
base.Append(EditPaste)
base.Append(EditSelectAll)
return true

MyTextArea.ConstructContextualMenu, line 2
This item does not exist
base.Append(EditCut)

… repeat for all items

try EDITCUT.CLONE instead

Did you add ConstructContextualMenu as a method or event handler? It needs to be an event handler. You’ll also need to do what Dave said.

This didn’t work but I can reference my own menubar but it’s messy -

base.Append(MenuAddEdit.item(1).item(0))
base.Append(MenuAddEdit.item(1).item(1))

Where menubar items are - File | Edit
Submenu Edit > Cut,Copy etc

regardless. you should still use the CLONE attribute

[quote=431103:@Craig Grech]Where menubar items are - File | Edit
Submenu Edit > Cut,Copy etc[/quote]
It just depends on the name attribute of the menu items. They default to EditCut, EditCopy etc, but it looks like you may have renamed them. (based on the MenuAddEdit name)

Craig, you are unnecessarily duplicating work and will make it harder for yourself in the future (you might know NOW what you did but how about next year?). There should only be ONE EditCopy, so as Dave suggested (twice) use the clone method.

Right, Probably the first thing I did when I started this project in 2009 with Real Basic. Didn’t realise I had given it a different name and added more controls so I could substitute it for the default menu.