none
Menu Strip And Tool Strip Items Disappeared AGAIN and AGAIN RRS feed

  • Question

  • This problem occur again after many years!!

    If you take a look into many forums it's a bug that persist from at least 15 years!!!!

    Microsoft???? what are you doing?? You update, upgrade and go on version and version, but this little, but important problems that make losing a lot of time to developers remain again and again!!!

    The solution is to open the .designer file, and re-add the missing line:

    Me.Toolstrip1.Items.AddRange...... eccc..

    but what are you waiting for to fix these bugs?


    Riccardo

    Thursday, September 13, 2018 8:54 AM

All replies

  • This is a developer forum for questions to other developers... 

    If you want to report a bug, use the Feedback button in the upper right of the title bar in visual studio, next to the quick launch bar.

    I haven't had any unexpected designer errors in VS2017 like this.  I agree it used to occur in earlier versions for no apparent reason, but the only way I've found to break a designer file in 2017 is by improperly changing something... like editing a user control while an instance of that control is already on a form.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Thursday, September 13, 2018 10:30 AM
    Moderator
  • Yeah. When I had problems like this I eventually got rid of it by remaking my old old form in the new .net and something like VS 2010.

    I also discovered that most of the problem was due to using toolstrips in a split container. When I stopped that then the tool strips seemed to work better. Also I stopped allowing the user to move the toolstrips and save the settings on exit and then it all started working more consistently.

    And finally a funny error due to using imagelist which I then also rebuilt from scratch in the new Visual Studio.

    So those all seemed to be errors I was dragging along in my form from vb6 conversions or before which I could no longer reproduce once I remade the form which was no easy task.

    Just something to think about.

    Thursday, September 13, 2018 2:01 PM
  • note to self....dont use menu/toolstrip.

    Live as if you were going to die today, learn as if you were going to live forever -Mahatma Gandhi

    Thursday, September 13, 2018 3:11 PM
  • note to self....dont use menu/toolstrip.

    Live as if you were going to die today, learn as if you were going to live forever -Mahatma Gandhi

    Ha ha. Well, I am not saying dont use the strips. In fact they work fine now in vs 2015 it seems?

    Its just that old wayback form versions need to get completely remade sometimes with the new version.

    Thursday, September 13, 2018 3:50 PM
  •  I have had this or a similar problem with the ToolStrip controls in my Gif Creator program.  I forget if I started that with VS2008 targeting Framework 3.5 or VS2010 targeting Framework 4.0 but,  I do remember always having to go to my last project backup and copy/paste my Form.Designer.Vb code into the current project to fix the missing toolstrip items.

     I have not had it happen in VS2015 Community when working on Gif Creator but,  then again, I have not really been doing any reworking of the ToolStrip and it's Items either.


    If you say it can`t be done then i`ll try it

    Thursday, September 13, 2018 6:45 PM
  • I forgot to write the version of VS I'm using:
    VS 2017 king. 15.8.2
    Framework 4.7.03056
    Framework used in the application: 4
    Toolstrip version: 4.0.0.0
    The project is new, as well as the form I was talking about, It is not an import from old projects.

    The only different thing is that it actually contains a usercontrol (but the toolstrip has nothing to do with it).
    It is also possible that I modified the form while in a designer window the usercontrol remained open .... But where is it written that this can give problems in the file designer?

    Riccardo

    Friday, September 14, 2018 7:51 AM
  • Hi,

    I used to encounter this situation when I used C#. Finally I found out that because I deleted the Resource file, the Form.designer.cs file will automatically delete some layout code of the Form. 

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 19, 2018 8:19 AM
    Moderator
  • FWIW, yesterday, at the end of the day, while developing a complicated industrial-strength program in Visual Basic (2017), the top menu and toolbar items disappeared. The interface also lost its references to all the other buttons on the screen. How discouraging.

    So, today I loaded the last full backup, and all the menus and buttons were there. On the internet, I googled “Visual Basic toolstrip collection empty”, and I found a revealing webpage:

    https://social.msdn.microsoft.com/Forums/en-US/71103c3e-c43f-42e8-b8c7-7387621467f8/menu-strip-and-tool-strip-items-disappeared?forum=Vsexpressvb

    Based on this, I used the WInMerge program (https://www.youtube.com/watch?v=JIytZ6a5yPE&app=desktop) to compare the Current and Backup folders and subfolders. This showed quite a few differences, many changes of which I recognized as legitimate changes I made since the last backup. I then used WinMerge to compare the lines for just the suspect file: Main.Designer.vb. WinMerge allowed me to rapidly copy the missing blank gray lines in Current from Backup. This worked!

    Note that every missing line started with “Global.UsingEngine.My.Resources.Resources.___,” e.g.,

    Global.UsingEngine.My.Resources.Resources.Square_Button_Blue_Blank

    Global.UsingEngine.My.Resources.Resources.Coffee

    Global.UsingEngine.My.Resources.Resources.red_led_on_hi

    These files references appear to all be stored in the file resources.resx. It would have taken me another full day to find and make these changes manually.

    I noted that Main.Designer.vb was timestamped today at 1:54 (when I made the WinMerge changes, but the resources.resx file, which contained all the referenced files, was timestamped almost two months ago. So, it does not appear that the resources.resx disappeared and was recreated. This has the feel of a bug in Visual Studio that deleted the file references that started with Global.UsingEngine.My.Resources.Resources.___” even though the referenced source file and all the files to which it pointed were available.

    Wednesday, October 9, 2019 7:37 PM