HOW TO DISABLE MENU EDITOR ADD NEW

I am evaluation your Win Form designer. It seems working very well. However I have one question. Your editor shows the menu of on my form correctly. Hoever it also lets you add new menu items. How can I disable the add new items feature.
Hi,
Could you please clarify what you mean by "editor shows the menu of on my form correctly. Hoever it also lets you add new menu items"? A screenshot showing the menu in question would help.
Sure. Here is a screenshot. It shows a menu bar. What I want is to disable those Type Here items so the user cannot add new items.
How can I attached an image here?
You can try pasting an image from clipboard into the post editor. Or you can upload image somewhere (Dropbox, Google Drive etc), and post a link to it here.
https://drive.google.com/file/d/1xd2K-bz6zMUZHq73F_Nt9DW0yZCJU8uN/view?usp=sharing
Here is the code to disable "add here" buttons for the top level menu strip:
class MyFormDesignerControl : FormDesignerControl
{
class MyFormDesignerHostContext : FormDesignerHostContext
{
public MyFormDesignerHostContext(FormDesignerControl owner, IFormDesignerDataSource source) : base(owner, source)
{
}

protected override IToolboxServiceExtended CreateToolboxService()
{
ServiceContainer.RemoveService(typeof(System.ComponentModel.Design.DesignerOptionService));
var s = new System.Windows.Forms.Design.WindowsFormsDesignerOptionService();
s.CompatibilityOptions.EnableInSituEditing = false;
ServiceContainer.AddService(typeof(System.ComponentModel.Design.DesignerOptionService), s);

return base.CreateToolboxService();
}
}

protected override IFormDesignerHostContext CreateContext(IFormDesignerDataSource source)
{
return new MyFormDesignerHostContext(this, source);
}
}
You will need to use the MyFormDesignerControl class instead of FormDesignerControl. Also you will need to add a reference to System.Design.dll to your project.
As for the "add new" buttons in the popup menus - unfortunately we didn't find a suitable way to hide them. Alternatively, you could derive your own classes for the menu item controls, override the designer attributes on them, and use those classes in your forms. Then, there will be no design item support for those items and they will not be editable. If this suits you, we can send you a code sample of how to accomplish that.

Sorry about this delay. Now I am back to Windows Forms editor.

I tried the code you sent, and it worked. However, as you mentioned the popup still has the add field. I am not sure if I got the suggestion right. It was to derive my own menu control, change the attributes so the editor would not use the designer feature for the specific class.

I am planning to create a form preview for localization. So, the use would use the preview to move and resize the control but all other features such as deleting or adding control would be disabled. Adding menu is also something I would liek to disable. However, this would need to work with all controls, not only my special controls.

It seems that you editor relies on the built in Windows Forms designer features and turning some editor feature off is not that easy. Am I right?

Best regards,
Jaakko

Hello Jaakko,

Since it is 2 years later, we do not recall you exact requirements. Also the image by the link to Google Drive you sent us earlier is not available any more. Could you please send us some screenshots illustrating your latest requirements again?