3 Answers, 1 is accepted
Hello, Serg,
Please have a look at the following help article which demonstrates how to create and show a RadContextMenu for a certain control: https://docs.telerik.com/devtools/winforms/controls/menus/contextmenu/add-context-menu-in-code
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
ps By default, it exits to the right of the point
Hello, Serg,
The RadContextMenu.Show method accepts a parameter specifying the exact location where to show the menu. If you want to show the menu at the left side of the cursor, you just need to adjust the location:
RadContextMenu radContextmenu = new RadContextMenu();
public RadForm1()
{
InitializeComponent();
RadMenuItem menuItem1 = new RadMenuItem();
menuItem1.Text = "Show";
radContextmenu.Items.Add(menuItem1);
RadMenuItem menuItem2 = new RadMenuItem();
menuItem2.Text = "Hide";
radContextmenu.Items.Add(menuItem2);
}
private void radButton1_Click(object sender, EventArgs e)
{
var args = e as MouseEventArgs;
radContextmenu.Show(this.radButton1, new Point(args.Location.X - radContextmenu.DropDown.Width, args.Location.Y));
}
private void RadForm1_Load(object sender, EventArgs e)
{
radContextmenu.DropDown.LoadElementTree();
}
I believe that it would fit your needs.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.