How to display a Windows 7 style context menu?

1.8k views Asked by At

Context menus

In my .NET applications, context menus look like the left one.

How can I apply the Windows 7 style on them in order to make them look like the right one?

1

There are 1 answers

4
Hans Passant On BEST ANSWER

Right-click the tool box, Choose Items. Tick "ContextMenu", the one with Namespace = System.Windows.Forms and Directory = Global Assembly Cache.

This .NET 1.x component is distinct from ContextMenuStrip, it uses native Windows menus. You'll lose some capabilities, I doubt you care. You'll need to write a line of code to assign the menu, the designer only lets you set the ContextMenuStrip property. Add that line to the constructor, like:

    public Form1() {
        InitializeComponent();
        this.ContextMenu = contextMenu1;
    }