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
  1. Home
  2. General Programming
  3. C#
  4. Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!!

Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!!

Scheduled Pinned Locked Moved C#
helpcsharpcomquestion
6 Posts 3 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.
  • N Offline
    N Offline
    nelsonpaixao
    wrote on last edited by
    #1

    In my application i have a form designed with 8 Usercontrols (pages), 1 StatusStrip (bottom) and 1 ToolStrip (top). The application works like this: i press a button to switch usercontrols, that work as pages, so, i go from menu login_page to menu_page and from there to any other page. I manage all this with the help of a visibility method delegate. Login_page load is different from all, only because ToolStrip is not visible, in any other "page" load both ToolStrip and StatusStrip are visible. (i do that because in login_page i manage logins, so only after login i allow ToolStrip controls to the user!!!, so, before login the toolstrip is not visible) So whats wrong? nothing. When i open the project in c# (not run it) i get the message bellow inside the form, but when i run it everthing works sweet, 100% like i want.:confused: <System.NullReferenceException: Object reference not set to an instance o an object. at Use_Usercontrols_as_Pages.Usercontrol_PageMenu.Usercontrol_PageMenu_VisibleChanged (object sender, eventargs e) in ...UserControls_as_pages|use_usercontrols_as_Pages\Usercontrol_PageMenu.cs:line 56 at system.windows.forms.controls.onvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.control.onparentvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.form..onvisiblechanged(eventargs e) at system.windows.forms.control.wmshowwindow(message&m) at system.windows.forms.scrollablecontrol.wndproc(message&m) at system.windows.forms.containercontrol.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.control.controlnativewndow.onmessage(message&m)>

    nelsonpaixao@yahoo.com.br trying to help & get help

    modified on Thursday, November 20, 2008 7:35 PM

    C L N 3 Replies Last reply
    0
    • N nelsonpaixao

      In my application i have a form designed with 8 Usercontrols (pages), 1 StatusStrip (bottom) and 1 ToolStrip (top). The application works like this: i press a button to switch usercontrols, that work as pages, so, i go from menu login_page to menu_page and from there to any other page. I manage all this with the help of a visibility method delegate. Login_page load is different from all, only because ToolStrip is not visible, in any other "page" load both ToolStrip and StatusStrip are visible. (i do that because in login_page i manage logins, so only after login i allow ToolStrip controls to the user!!!, so, before login the toolstrip is not visible) So whats wrong? nothing. When i open the project in c# (not run it) i get the message bellow inside the form, but when i run it everthing works sweet, 100% like i want.:confused: <System.NullReferenceException: Object reference not set to an instance o an object. at Use_Usercontrols_as_Pages.Usercontrol_PageMenu.Usercontrol_PageMenu_VisibleChanged (object sender, eventargs e) in ...UserControls_as_pages|use_usercontrols_as_Pages\Usercontrol_PageMenu.cs:line 56 at system.windows.forms.controls.onvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.control.onparentvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.form..onvisiblechanged(eventargs e) at system.windows.forms.control.wmshowwindow(message&m) at system.windows.forms.scrollablecontrol.wndproc(message&m) at system.windows.forms.containercontrol.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.control.controlnativewndow.onmessage(message&m)>

      nelsonpaixao@yahoo.com.br trying to help & get help

      modified on Thursday, November 20, 2008 7:35 PM

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      When I was an MVP, I reported this as a bug. MS thinks it's a feature, but in fact, it's one of the stupidest changes they've ever made. The IDE runs some, but not all, of your code, and if your code doesn't work when only part of it is run, it won't show in the designer. If you attach one instance of the IDE to another, then you can use the IDE to 'debug' your code. Of course, your code is not broken, the IDE is. You will need to rework your code if you want to use the designer. Which is the stupidest thing ever.

      Christian Graus Driven to the arms of OSX by Vista.

      N 1 Reply Last reply
      0
      • C Christian Graus

        When I was an MVP, I reported this as a bug. MS thinks it's a feature, but in fact, it's one of the stupidest changes they've ever made. The IDE runs some, but not all, of your code, and if your code doesn't work when only part of it is run, it won't show in the designer. If you attach one instance of the IDE to another, then you can use the IDE to 'debug' your code. Of course, your code is not broken, the IDE is. You will need to rework your code if you want to use the designer. Which is the stupidest thing ever.

        Christian Graus Driven to the arms of OSX by Vista.

        N Offline
        N Offline
        nelsonpaixao
        wrote on last edited by
        #3

        hi, thanks for the post. ;) this application is meent to be my first article submition to codeproject you know? but i really dont know what to make of this, like i said everthing works!!! i think is not nice to submit a article with that kind of ..."error" or what ever it is:confused: i really dont know that IDE stuff you know?! where can "find" it to change?

        nelsonpaixao@yahoo.com.br trying to help & get help

        C 1 Reply Last reply
        0
        • N nelsonpaixao

          hi, thanks for the post. ;) this application is meent to be my first article submition to codeproject you know? but i really dont know what to make of this, like i said everthing works!!! i think is not nice to submit a article with that kind of ..."error" or what ever it is:confused: i really dont know that IDE stuff you know?! where can "find" it to change?

          nelsonpaixao@yahoo.com.br trying to help & get help

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Like I said, attach one IDE to another, then try to view the control in the designer, your attached IDE will catch the 'exception' and show you where an object in your code is in a bad state, because not all of your code was run by the IDE.

          Christian Graus Driven to the arms of OSX by Vista.

          1 Reply Last reply
          0
          • N nelsonpaixao

            In my application i have a form designed with 8 Usercontrols (pages), 1 StatusStrip (bottom) and 1 ToolStrip (top). The application works like this: i press a button to switch usercontrols, that work as pages, so, i go from menu login_page to menu_page and from there to any other page. I manage all this with the help of a visibility method delegate. Login_page load is different from all, only because ToolStrip is not visible, in any other "page" load both ToolStrip and StatusStrip are visible. (i do that because in login_page i manage logins, so only after login i allow ToolStrip controls to the user!!!, so, before login the toolstrip is not visible) So whats wrong? nothing. When i open the project in c# (not run it) i get the message bellow inside the form, but when i run it everthing works sweet, 100% like i want.:confused: <System.NullReferenceException: Object reference not set to an instance o an object. at Use_Usercontrols_as_Pages.Usercontrol_PageMenu.Usercontrol_PageMenu_VisibleChanged (object sender, eventargs e) in ...UserControls_as_pages|use_usercontrols_as_Pages\Usercontrol_PageMenu.cs:line 56 at system.windows.forms.controls.onvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.control.onparentvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.form..onvisiblechanged(eventargs e) at system.windows.forms.control.wmshowwindow(message&m) at system.windows.forms.scrollablecontrol.wndproc(message&m) at system.windows.forms.containercontrol.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.control.controlnativewndow.onmessage(message&m)>

            nelsonpaixao@yahoo.com.br trying to help & get help

            modified on Thursday, November 20, 2008 7:35 PM

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Hi, as the exception indicates, have a look at line 56 of file Usercontrol_PageMenu.cs chances are adding a null test will fix things. BTW: make sure your IDE always shows line numbers, that will make things a lot easier: Compiler errors and run-time exceptions tend to show line numbers (look at Exception.ToString(), not Exception.Message). The Visual Studio editor can show them too, but for some mysterious reason does not do so by default; see menu Tools/Options/Text Editor/All Languages/General/... If you turn them on, you'll locate problem spots much more easily. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            Fixturized forever. :confused:


            1 Reply Last reply
            0
            • N nelsonpaixao

              In my application i have a form designed with 8 Usercontrols (pages), 1 StatusStrip (bottom) and 1 ToolStrip (top). The application works like this: i press a button to switch usercontrols, that work as pages, so, i go from menu login_page to menu_page and from there to any other page. I manage all this with the help of a visibility method delegate. Login_page load is different from all, only because ToolStrip is not visible, in any other "page" load both ToolStrip and StatusStrip are visible. (i do that because in login_page i manage logins, so only after login i allow ToolStrip controls to the user!!!, so, before login the toolstrip is not visible) So whats wrong? nothing. When i open the project in c# (not run it) i get the message bellow inside the form, but when i run it everthing works sweet, 100% like i want.:confused: <System.NullReferenceException: Object reference not set to an instance o an object. at Use_Usercontrols_as_Pages.Usercontrol_PageMenu.Usercontrol_PageMenu_VisibleChanged (object sender, eventargs e) in ...UserControls_as_pages|use_usercontrols_as_Pages\Usercontrol_PageMenu.cs:line 56 at system.windows.forms.controls.onvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.control.onparentvisiblechanged(eventargs e) at system.windows.forms.scrollablecontrol.onvisiblechanged(eventargs e) at system.windows.forms.form..onvisiblechanged(eventargs e) at system.windows.forms.control.wmshowwindow(message&m) at system.windows.forms.scrollablecontrol.wndproc(message&m) at system.windows.forms.containercontrol.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.form.wndproc(message&m) at system.windows.forms.control.controlnativewndow.onmessage(message&m)>

              nelsonpaixao@yahoo.com.br trying to help & get help

              modified on Thursday, November 20, 2008 7:35 PM

              N Offline
              N Offline
              nelsonpaixao
              wrote on last edited by
              #6

              crap, i going to figure it out some how :wtf:

              nelsonpaixao@yahoo.com.br trying to help & get help

              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