cmanning Posted February 18, 2003 Posted February 18, 2003 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? Quote
Cywizz Posted February 18, 2003 Posted February 18, 2003 A lot of posts around this topic..... see: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=69308&highlight=mdi%2A Quote Howzit??
*Gurus* divil Posted February 18, 2003 *Gurus* Posted February 18, 2003 You need to cast it to the correct type before you can access members of it, e.g. ((frmMain)this.MDIParent).Property = value; Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
cmanning Posted February 19, 2003 Author Posted February 19, 2003 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. Quote
*Experts* Volte Posted February 19, 2003 *Experts* Posted February 19, 2003 Are you making sure to put this code inside one of the MDI children, ranther than inside the MDI parent? Quote
cmanning Posted February 19, 2003 Author Posted February 19, 2003 I am entering this code in the closed event of the MDI Child form named "fclsAdminTool". Quote
*Experts* Volte Posted February 19, 2003 *Experts* Posted February 19, 2003 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. Quote
cmanning Posted February 19, 2003 Author Posted February 19, 2003 same error. grrrrrr..... do i need to reference the already existing method of the fclsMain MDI Parent ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.