The code at the end of this compiles and turns up in the Toolbox. When I try to drop it on a Form or UserControl surface I get a message box with the message "Top-level control cannot be added to a control". My intention is/was to create a component based on ContextMenuStrip that would contain the logic for processing the users selection within the context menu itself rather than the form/control to which the contextmenu is attached.

I'd really appreciate some help on this one as it has me stumped, to the point that I'm thinking of reinstalling VS C#.

Thanks PhilD


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;

namespace Catalogue.Technical
{
[ToolboxItem(true)]
[Description("Lookup Item Context Menu")]
[ToolboxBitmap(typeof(System.Windows.Forms.ContextMenuStrip))]
[DesignerAttribute(typeof(Catalogue.DesignServices.catDesignAction))]
public class catLookupContextMenu : System.Windows.Forms.ContextMenuStrip {
public catLookupContextMenu() {
this.myType = this.GetType();
this.myName = this.myType.Name;
}
private Type myType;
private string myName;
}
}