Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Error when adding a ToolStripMenuItem [modified]

Error when adding a ToolStripMenuItem [modified]

Scheduled Pinned Locked Moved C#
helpdebuggingquestioncsharpdatabase
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lucy
    wrote on last edited by
    #1

    I am having trouble adding a ToolStripMenuItem but I do not know why. I have so far added many ToolStripMenuItems as follows: File New Save Save As Print Close Format Font Colour Help Contents Index Search About I want to add 3 more items under the Format menu, these being: Bold, Italic, Underlined. Each time I click on the drop down menu at design time and type Bold where it says 'Type Here' and then click away (This menu item with the text Bold should be saved) but the new menu item disappears as though I have not typed anything. When I try to type Bold again this error appears in a dialog box: The control System.Windows.Forms.TextBox has thrown an unhandled exception in the designer and has been disabled. Exception: Object reference not set to an instance of an object. Stack trace: I then get an error from Visual Studio saying: Microsoft Visual Studio has encounted a problem and needs to close. Also in this dialog box, there are 3 buttons, Debug, Send Error Report and Don't Send. Can anyone advise me as to what is going wrong when I try to add a ToolStripMenuItem? Lucy

    T A RaviBeeR 3 Replies Last reply
    0
    • L Lucy

      I am having trouble adding a ToolStripMenuItem but I do not know why. I have so far added many ToolStripMenuItems as follows: File New Save Save As Print Close Format Font Colour Help Contents Index Search About I want to add 3 more items under the Format menu, these being: Bold, Italic, Underlined. Each time I click on the drop down menu at design time and type Bold where it says 'Type Here' and then click away (This menu item with the text Bold should be saved) but the new menu item disappears as though I have not typed anything. When I try to type Bold again this error appears in a dialog box: The control System.Windows.Forms.TextBox has thrown an unhandled exception in the designer and has been disabled. Exception: Object reference not set to an instance of an object. Stack trace: I then get an error from Visual Studio saying: Microsoft Visual Studio has encounted a problem and needs to close. Also in this dialog box, there are 3 buttons, Debug, Send Error Report and Don't Send. Can anyone advise me as to what is going wrong when I try to add a ToolStripMenuItem? Lucy

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      Perhaps its just some bug, or visual studio hates you. Try adding the menu in the code, rather than the designer. It shouldn't be hard to figure out how, there's already at least 15 examples. Once youv'e added it, go back to the designer and see what it does, if it still comes up with the error then i can see your going to have alot of fun. If not, then i guess you can forget about it.

      My current favourite word is: Waffle Cheese is still good though.

      1 Reply Last reply
      0
      • L Lucy

        I am having trouble adding a ToolStripMenuItem but I do not know why. I have so far added many ToolStripMenuItems as follows: File New Save Save As Print Close Format Font Colour Help Contents Index Search About I want to add 3 more items under the Format menu, these being: Bold, Italic, Underlined. Each time I click on the drop down menu at design time and type Bold where it says 'Type Here' and then click away (This menu item with the text Bold should be saved) but the new menu item disappears as though I have not typed anything. When I try to type Bold again this error appears in a dialog box: The control System.Windows.Forms.TextBox has thrown an unhandled exception in the designer and has been disabled. Exception: Object reference not set to an instance of an object. Stack trace: I then get an error from Visual Studio saying: Microsoft Visual Studio has encounted a problem and needs to close. Also in this dialog box, there are 3 buttons, Debug, Send Error Report and Don't Send. Can anyone advise me as to what is going wrong when I try to add a ToolStripMenuItem? Lucy

        T Offline
        T Offline
        TJoe
        wrote on last edited by
        #3

        What version of Visual Studio are you running?

        Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

        L 1 Reply Last reply
        0
        • T TJoe

          What version of Visual Studio are you running?

          Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

          L Offline
          L Offline
          Lucy
          wrote on last edited by
          #4

          I am using Visual Studio 2005. Yes I can add the menu item into the code easily and with no errors. Lucy

          1 Reply Last reply
          0
          • L Lucy

            I am having trouble adding a ToolStripMenuItem but I do not know why. I have so far added many ToolStripMenuItems as follows: File New Save Save As Print Close Format Font Colour Help Contents Index Search About I want to add 3 more items under the Format menu, these being: Bold, Italic, Underlined. Each time I click on the drop down menu at design time and type Bold where it says 'Type Here' and then click away (This menu item with the text Bold should be saved) but the new menu item disappears as though I have not typed anything. When I try to type Bold again this error appears in a dialog box: The control System.Windows.Forms.TextBox has thrown an unhandled exception in the designer and has been disabled. Exception: Object reference not set to an instance of an object. Stack trace: I then get an error from Visual Studio saying: Microsoft Visual Studio has encounted a problem and needs to close. Also in this dialog box, there are 3 buttons, Debug, Send Error Report and Don't Send. Can anyone advise me as to what is going wrong when I try to add a ToolStripMenuItem? Lucy

            RaviBeeR Offline
            RaviBeeR Offline
            RaviBee
            wrote on last edited by
            #5

            Is your form's designer file read-only? /ravi

            This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

            L 1 Reply Last reply
            0
            • RaviBeeR RaviBee

              Is your form's designer file read-only? /ravi

              This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

              L Offline
              L Offline
              Lucy
              wrote on last edited by
              #6

              No none of my files are read-only. Lucy

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups