"Press" a menu item or run an internal command

How does one “press” a menu item or run the underlying built-in code for a menu item?

The built-in copy function in Xojo works great in a listbox, but Cut doesn’t. I’d like to implement a Cut function by calling the Copy function and then deleting the selected rows. No need to re-invent the wheel, as it were…

So how would I go about “clicking” the copy menu item or running it’s underlying code?

if all you want to do is replicate cut/copy functions use the clipboard object

messy as heck but doable
I just would find a different way instead of what I have sorted out :stuck_out_tongue:

For some reason, there’s a Copy function that works on the ListBox natively, however there’s no Cut, Clear or Paste. The last 2 are easy, and Cut is just Copy & Clear, so I wanted to use the native Copy function to do that instead of writing my own Cut function from scratch. Easy as it might have been to do that, I would rather do things the hard way! :wink:

here’s a demo of it working.

And here’s a demo project that shows how I did it.