locked
menu items showing twice RRS feed

  • Question

  • i have a problem  using visual c# 2010 express

    i have a school project where we have to make a webbrowser using the webbrowser control

    i have a menu with file open,file save options and they all work great but when i debug, the menu appears twice

    but it doesn't on the designer, my teacher looked at it but could't find out what was wrong

    every new menu item i add does the same thing


    Monday, May 7, 2012 5:21 PM

Answers

  • I tried to reproduce this and cannot so here's some suggestions. Try looking at the properties window and double checking that there are not two menu strips in the list at the top. If there are then you should see two in the bar below the form in designer. In which case one of them has to go.

    If there are not two in designer, then have you added one in code? That won't show in the designer, but will appear when it is run.

    If you have not added one then you could try looking in the Form1.Designer.cs file and seeing if there are two in that. There should not be (since they should show in the designer window). If there are then somehow it has been corrupted and VS is not handling it properly.

    Have you tried running the .exe file form Explorer? It may be that the debugger is confused (unlikely but you never know) and the .exe only shows one.

    Finally, you could try starting a new project and use Solution Explorer to add the existing files. It will make copies so your original project is unchanged.  That may clear it up.

    If none of these are the case, I cannot suggest any thing else off hand.


    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

    Monday, May 7, 2012 11:04 PM

All replies

  • I tried to reproduce this and cannot so here's some suggestions. Try looking at the properties window and double checking that there are not two menu strips in the list at the top. If there are then you should see two in the bar below the form in designer. In which case one of them has to go.

    If there are not two in designer, then have you added one in code? That won't show in the designer, but will appear when it is run.

    If you have not added one then you could try looking in the Form1.Designer.cs file and seeing if there are two in that. There should not be (since they should show in the designer window). If there are then somehow it has been corrupted and VS is not handling it properly.

    Have you tried running the .exe file form Explorer? It may be that the debugger is confused (unlikely but you never know) and the .exe only shows one.

    Finally, you could try starting a new project and use Solution Explorer to add the existing files. It will make copies so your original project is unchanged.  That may clear it up.

    If none of these are the case, I cannot suggest any thing else off hand.


    Regards David R
    ---------------------------------------------------------------
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.
    Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.
    Every program eventually becomes rococo, and then rubble. - Alan Perlis
    The only valid measurement of code quality: WTFs/minute.

    Monday, May 7, 2012 11:04 PM
  • thanks for the response

    i made a new project and created the webbrowser again and now everything is working

    thanks for your time

    Tuesday, May 8, 2012 9:39 AM