Is there any way to use a radContextMenu with the WinForms NotifyIcon? I'd like to use the radMenus for my WinForms app, but I need the NotifyIcon functionality, and I can't see how to use rad Menus with it.
Thanks,
Helen
2 Answers, 1 is accepted
0
Accepted
Stefan
Telerik team
answered on 12 Oct 2012, 08:51 AM
Hello Helen,
Thank you for writing.
Here is how to incorporate RadContextMenu with NotifyIcon:
public partial class Form1 : Form
{
RadContextMenu contextMenu = new RadContextMenu();
public Form1()
{
InitializeComponent();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
notifyIcon1.Icon = new Icon(@"C:\Program Files (x86)\Telerik\RadControls for WinForms Q2 2012 SP2\Examples\QuickStart\Resources\telerik.ico");
notifyIcon1.Text = "Form1 (NotifyIcon example)";
notifyIcon1.Visible = true;
notifyIcon1.MouseDown += new MouseEventHandler(notifyIcon1_MouseDown);
contextMenu.Items.Add(new RadMenuHeaderItem("Hello, I am RadContextMenu"));
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
contextMenu.Show(MousePosition);
}
}
}
I hope that the provided information addresses your questions. Should you have any further questions, do not hesitate to contact me.
Greetings,
Stefan
the Telerik team
You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.