Feb 18, 2003 #1 C cmanning Newcomer Joined Feb 18, 2003 Messages 8 I have a MDI child that when closed need to uncheck a submenu control in my MDI Parent form. What code do I need to use to do this?
I have a MDI child that when closed need to uncheck a submenu control in my MDI Parent form. What code do I need to use to do this?
Feb 18, 2003 #2 C Cywizz Centurion Joined Jan 31, 2003 Messages 136 Location JHB, South Africa A lot of posts around this topic..... see: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69308&highlight=mdi*
A lot of posts around this topic..... see: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69308&highlight=mdi*
Feb 18, 2003 #3 D divil Ultimate Contributor Joined Nov 17, 2002 Messages 2,746 Location England You need to cast it to the correct type before you can access members of it, e.g. C#: ((frmMain)this.MDIParent).Property = value;
You need to cast it to the correct type before you can access members of it, e.g. C#: ((frmMain)this.MDIParent).Property = value;
Feb 18, 2003 #4 C cmanning Newcomer Joined Feb 18, 2003 Messages 8 This is the message I get when I enter the above code... "An unhandled exception of type 'System.NullReferenceException' occurred in NGRCommOps.exe Additional information: Object reference not set to an instance of an object." This is the code I entered to mirror what is aboce. ((fclsMain)this.MdiParent).mnuAdminTool.Checked = false; Thoughts. Any help you can give is appreciated. Am I missing a callout.
This is the message I get when I enter the above code... "An unhandled exception of type 'System.NullReferenceException' occurred in NGRCommOps.exe Additional information: Object reference not set to an instance of an object." This is the code I entered to mirror what is aboce. ((fclsMain)this.MdiParent).mnuAdminTool.Checked = false; Thoughts. Any help you can give is appreciated. Am I missing a callout.
Feb 18, 2003 #5 V Volte Neutiquam Erro Joined Nov 17, 2002 Messages 2,172 Are you making sure to put this code inside one of the MDI children, ranther than inside the MDI parent?
Are you making sure to put this code inside one of the MDI children, ranther than inside the MDI parent?
Feb 18, 2003 #6 C cmanning Newcomer Joined Feb 18, 2003 Messages 8 I am entering this code in the closed event of the MDI Child form named "fclsAdminTool".
Feb 18, 2003 #7 V Volte Neutiquam Erro Joined Nov 17, 2002 Messages 2,172 Ah; try putting it in the 'Closing' event. I believe that in the 'Closed' event, the form no longer exists, and therefore cannot be used like that.
Ah; try putting it in the 'Closing' event. I believe that in the 'Closed' event, the form no longer exists, and therefore cannot be used like that.
Feb 19, 2003 #8 C cmanning Newcomer Joined Feb 18, 2003 Messages 8 same error. grrrrrr..... do i need to reference the already existing method of the fclsMain MDI Parent ?
same error. grrrrrr..... do i need to reference the already existing method of the fclsMain MDI Parent ?