How to Add Custom ContextMenu for RadTextBox
Environment
Product Version | Product | Author |
---|---|---|
2022.1.222 | RadTextBox for WinForms | Desislava Yordanova |
Description
By default, RadTextBox offers the following context menu after right-clicking the controls:
This is actually the context menu for the hosted TextBox that Microsoft offers.
This article demonstrates a sample approach how to eliminate the default menu and assign your custom one.
Solution
In order to remove the default context menu, it is necessary to set the RadTextBox.TextBoxElement.TextBoxItem.HostedControl.ContextMenuStrip property to a new instance of ContextMenuStrip:
However, if you want to achieve your custom items, it is necesary to create your own ContextMenuStrip