We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

can child access parent without instancing?

Thread ID:

Created:

Updated:

Platform:

Replies:

5017 Jun 14,2003 06:53 AM Jun 30,2003 01:04 PM Windows Forms 1
loading
Tags: FAQ
andreas
Asked On June 14, 2003 06:53 AM

I have a main form which has several child forms. One of child forms is a form with help (helpForm). I am trying to add a code which would allow any child to open a form with helpForm when user presses F1. The problem is how to access a function in mainform from child without instancing, as when I instance a mainform in child form, then I ahve a problem with determining is helpForm open or not. Also is there a way of accessing a variable declared in main form from child forms without instancing main form?

grer
Replied On June 30, 2003 01:04 PM

IS this an MDI application or and SDI? If mdi then you can access the parent with midparent property. and just cast it to the main form. If SDI, then you can use reflection ot call the main form using methodinvoke. > I have a main form which has several child forms. One of child forms is a form with help (helpForm). > I am trying to add a code which would allow any child to open a form with helpForm when user presses F1. > The problem is how to access a function in mainform from child without instancing, as when I instance a mainform in child form, then I ahve a problem with determining is helpForm open or not. > Also is there a way of accessing a variable declared in main form from child forms without instancing main form? >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;