Get the standard context menu for System.Windows.Forms.RichTextBox

How to get the standard context menu in RichTextBox, for example, in a TextBox (Copy, Paste, IME, etc.)? I would go with a P / Invoke solution if nothing was out of the box. Or do I really need to follow these strange tips to create my own menu to get a standard menu (sigh)?

+4
source share
1 answer

The ContextMenuStrip property for richtextbox can be assigned to a user-created context menu, Copy / Cut / Paste, and simply apply RichTextBox methods to each of the menu items, such as CanUndo, CanCopy, CanPaste, to define the Enabled menu item. Using the Copy , Cut and Paste methods will be the executed method for the click event of a menu item.

Hope this helps, Regards, Tom.

+4
source

Source: https://habr.com/ru/post/1300869/


All Articles