I have a basic PowerShell form with a textbox
. When I right-click on the textbox
, a standard menu appears with Copy, Cut, Paste, etc…
My goal is to add a "clear log" option, that clears current textbox
content. How can I add this option to the right-click menu instead of doing/drawing an actual separate button?
Best Answer
To be able to show a ContextMenuStrip for a TextBox first you should set ShortcutsEnabled property of the TextBox to false, then assign a ContextMenuStrip to its ContextMenuStrip property like this: