473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Referencing a MDI Parent form from a Child

Ok here is my problem:

I have a MDI parent form called "Main" that I declare in a public
module when I start up my program. This form holds the drop down menu
that allows my users to access all of the child forms.

Now lets say I have a child form called "Child." When I open up that
child form from "Main" I shut off the menu on "Main" so that the user
cannot open up any other forms while they are in the "Child" form.

My problem is right before I close "Child" form and return to "Main" I
want to turn this menu back on. I can reference my global form "Main"
in the child form but it doesn't seem to work when I try to enable the
menu.

This is a problem that will cause me grief later on when I try to use
other things that I have painted on the "Main" form from child forms.

Can someone please tell me a way to reference things on "Main" from
"Child"

Thanks
Matt

Jul 20 '06 #1
2 2422
Matt,

The things you want to reference on the "Main" form need to be public.

You should be able to reference the MDI parent form from the child form like
this:

Me.MDIParent

Kerry Moorman
"Matt" wrote:
Ok here is my problem:

I have a MDI parent form called "Main" that I declare in a public
module when I start up my program. This form holds the drop down menu
that allows my users to access all of the child forms.

Now lets say I have a child form called "Child." When I open up that
child form from "Main" I shut off the menu on "Main" so that the user
cannot open up any other forms while they are in the "Child" form.

My problem is right before I close "Child" form and return to "Main" I
want to turn this menu back on. I can reference my global form "Main"
in the child form but it doesn't seem to work when I try to enable the
menu.

This is a problem that will cause me grief later on when I try to use
other things that I have painted on the "Main" form from child forms.

Can someone please tell me a way to reference things on "Main" from
"Child"

Thanks
Matt

Jul 20 '06 #2
Matt,

Every midi parent holds an array of its midi forms.
You have to find this by looping through the array, than you can reference
to that midi child using the founded collectionitem.

http://msdn.microsoft.com/library/de...ldrentopic.asp

I hope this helps,

Cor

"Matt" <Kr****@gmail.comschreef in bericht
news:11**********************@i42g2000cwa.googlegr oups.com...
Ok here is my problem:

I have a MDI parent form called "Main" that I declare in a public
module when I start up my program. This form holds the drop down menu
that allows my users to access all of the child forms.

Now lets say I have a child form called "Child." When I open up that
child form from "Main" I shut off the menu on "Main" so that the user
cannot open up any other forms while they are in the "Child" form.

My problem is right before I close "Child" form and return to "Main" I
want to turn this menu back on. I can reference my global form "Main"
in the child form but it doesn't seem to work when I try to enable the
menu.

This is a problem that will cause me grief later on when I try to use
other things that I have painted on the "Main" form from child forms.

Can someone please tell me a way to reference things on "Main" from
"Child"

Thanks
Matt

Jul 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sreddy | last post by:
I am trying to write a sql query on self referencing table. Just to brief ..Database is related to a Hiring department of the Qwest company. I need to generate a Report used by in HR...
2
by: Reply Via Newsgroup | last post by:
Folks, Windows, and refering to them (be they in seperate frames or in a popup) always catch me... There is parent, top, self, the name of the window itself and where it sits when refering to...
4
by: Randell D. | last post by:
Folks, I have a javascript function which is a popup - It contains a list in form tags - When the user selects a value in the popup, and clicks submit, I want the values to be transfered to the...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
by: Eddie | last post by:
If FormMain = MDI parent, FormSub = Child parent, I execute FormSub from the menu like this way. FormSub^ sub = gcnew FormSub; sub->MdiParent = this; sub->Show(); This can generate child...
21
by: cmd | last post by:
I have code in the OnExit event of a control on a subform. The code works properly in this instance. If, however, I put the same code in the OnExit event of a control on a Tab Control of a main...
2
by: libsfan01 | last post by:
Hi all How do u reference the id (and also now i think about it the name) of the enclosing div tag of a form element such as a button or div tag (without specifying its name)? I've tried:...
4
by: Steve Hershoff | last post by:
I have two UserControls I'd like to have talk to each other. One of them is contained within the other, in a parent/child relationship. The child control is loaded dynamically (it's declared as a...
4
by: Richard Lewis Haggard | last post by:
What is the mechanism by which a child window can notify its parent that it has been clicked on? -- Richard Lewis Haggard www.Haggard-And-Associates.com
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.