Alex
Alex

Reputation: 2111

vb.net and ContextMenuStrip?

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?

Upvotes: 0

Views: 601

Answers (2)

Hans Passant
Hans Passant

Reputation: 941465

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.

Upvotes: 1

Beth
Beth

Reputation: 9607

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.

Upvotes: 0

Related Questions