I'm working with a NotifyIcon
and ContextMenuStrip
, I don't want to use the default menu look and feel which is shipped out of the box with this control which is different to Windows (Vista in my case) by using contextMenu.RenderMode = ToolStripRenderMode.ManagerRenderMode
or contextMenu.RenderMode = ToolStripRenderMode.Professional
:
I don't want this using contextMenu.RenderMode = ToolStripRenderMode.System
:
I just want to use the standard, normal Windows "look and feel" as seen in countless, probably non-.net applications *grumble*:
Any ideas guys on how to achieve this?
On Vista, it renders correctly (i.e., the same way DropBox renders on my machine) when using all the defaults.
Here's a sample program that works for me. Try it, and if it doesn't render correctly for you, try uncommenting the two commented lines.
using System;
using System.Windows.Forms;
using System.Drawing;
public class AC : ApplicationContext
{
NotifyIcon ni;
public void menu_Quit(Object sender, EventArgs args)
{
ni.Dispose();
ExitThread();
}
public AC()
{
ni = new NotifyIcon();
ni.Icon = SystemIcons.Information;
ContextMenu menu = new ContextMenu();
menu.MenuItems.Add("Quit", new EventHandler(menu_Quit));
ni.ContextMenu = menu;
ni.Visible = true;
}
public static void Main(string[] args)
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
AC ac = new AC();
Application.Run(ac);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With