MenuStrip and ToolStripButton corruption
-
I created a few custom icons for buttons and menus. One image was added to a ContextMenuStrip item. Later I changed it to a different image. I removed the previous image from the Resources.resx file using the IDE. Now the all the MenuStrips and ToolStripButtons are gone! :mad: This image is not connected in any way to any of the other MenuItems or ToolStripButtons. Is there any way to repair the project? I have a backup but it's much older. Thanks in advance, Mark
-
I created a few custom icons for buttons and menus. One image was added to a ContextMenuStrip item. Later I changed it to a different image. I removed the previous image from the Resources.resx file using the IDE. Now the all the MenuStrips and ToolStripButtons are gone! :mad: This image is not connected in any way to any of the other MenuItems or ToolStripButtons. Is there any way to repair the project? I have a backup but it's much older. Thanks in advance, Mark
I've run across the same kinds of problems before. I always end up editing the Visual Studio generated file (Form1.Designer.cs or something like that if you're using C# ... not sure for VB) by hand. I usually find that all the control creation code is still there, but I need to re-establish the parent-child control relationships. Something like:
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileMenu, this.editMenu, this.helpMenu } );
Look at a valid project to see the exact syntax. -
I've run across the same kinds of problems before. I always end up editing the Visual Studio generated file (Form1.Designer.cs or something like that if you're using C# ... not sure for VB) by hand. I usually find that all the control creation code is still there, but I need to re-establish the parent-child control relationships. Something like:
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileMenu, this.editMenu, this.helpMenu } );
Look at a valid project to see the exact syntax. -
I created a few custom icons for buttons and menus. One image was added to a ContextMenuStrip item. Later I changed it to a different image. I removed the previous image from the Resources.resx file using the IDE. Now the all the MenuStrips and ToolStripButtons are gone! :mad: This image is not connected in any way to any of the other MenuItems or ToolStripButtons. Is there any way to repair the project? I have a backup but it's much older. Thanks in advance, Mark
Hi, Go to IntializeComponent() method and set the Contextmenu image property manually.