views:

22

answers:

2

I'm using winforms and vb.net. When I right click on a textbox I get the copy/paste/etc popup menu. This is ok. But How can I add something to this menu, and where/how would I intercept the event when one would click on the Item I add to it?

A: 

You'll have to add your own menu if you don't want to use the default.

You'll have to replace the existing default functions with your own code.

Beth
+1  A: 

This context menu is baked into Windows, there is no documented way to alter it. Nor is there a message that you could trap to hack the menu. Replacing it is certainly an option, check my answer in this thread for sample code.

Be careful with this, stuff gets added to this menu in different Windows versions. Like "Insert Unicode character" in Win7. You definitely want to avoid this if it is likely that your product will run in an Eastern Asian country.

Hans Passant