WinForm the icons on the menu and toolbars on the form designer are missing the recovery solution

Source: Internet
Author: User

Some time ago a friend asked me when he was designing the form because the resource file was not found,

There are no menu items on the menu bar in the Discovery window after the run, and the icon buttons on the toolbar are missing.

In this case, do not rush to the form of resource text, design files and code files to delete, or start from scratch, not worth the candle.

At this point, first look at your form resource file is missing icon file, for example, for the form browsequestion,



Open the Browsequestion.resx file first, and if there is no missing icon file, open the BrowseQuestion.designer.cs file,

Open the code that is automatically generated by the form designer and expand as shown in:




After you expand the auto-generated code for the form designer, find your own menuStrip1 (menu bar) and ToolStrip1 (toolbars),

See if This.menuStrip1.Items.AddRange is missing (new system.windows.forms.toolstripitem[] {...}); This code, as shown in:




If the Add control to the menu bar or toolbar is missing the *. Items.addrange () method, add the method as shown in the Rectangle box,

Put your own Menustripitem,toostripbutton,toolstriplabel (these can be found in the. designer.cs file, just no AddRange () to go in) and so add in,

Once saved, you can revert back to the original style.

WinForm the icons on the menu and toolbars on the form designer are missing the recovery solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.