New to Telerik UI for WinForms? Download free 30-day trial

Add Context menu in the code

This article demonstrates how you can add RadContextMenu in the code and attach it to a specific control.

1. Adding a RadContextMenu at runtime. To programmatically add a RadContextMenu to a form, create a new instance of a RadContextMenu

2. Add RadMenuItems to RadContextMenu.

3. Subscribe to МouseClick event of the control and call the RadContextMenu.Show() method:

4. Here is the result:

WinForms RadContextMenu Apply Sample

In this article