473,378 Members | 1,436 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,378 software developers and data experts.

Calling method in child form from MDI form?`

VM
How can I call a method in a child Form from within the parent MDI form? The
child form has a Save method but I'd also like to give the user the
opportunity to "save" from the MDI form also. They'd both run the same
method; the only difference is that one calls it from within the class that
draws the form while the other calls it from outside.

Thanks.
Nov 16 '05 #1
2 2467
Hi, VM

you have to keep reference to active child in main form. Then event handler
for main form command could find out, which child save method to call.

HTH
Alex

"VM" <vo******@yahoo.com> wrote in message
news:OG****************@TK2MSFTNGP11.phx.gbl...
How can I call a method in a child Form from within the parent MDI form? The child form has a Save method but I'd also like to give the user the
opportunity to "save" from the MDI form also. They'd both run the same
method; the only difference is that one calls it from within the class that draws the form while the other calls it from outside.

Thanks.

Nov 16 '05 #2
this is a code to close child forms from the parent MDI form.

foreach( Form f in this.MdiChildren )
{
f.Close();
}

"VM" <vo******@yahoo.com> wrote in message
news:OG****************@TK2MSFTNGP11.phx.gbl...
How can I call a method in a child Form from within the parent MDI form? The child form has a Save method but I'd also like to give the user the
opportunity to "save" from the MDI form also. They'd both run the same
method; the only difference is that one calls it from within the class that draws the form while the other calls it from outside.

Thanks.


Nov 16 '05 #3

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

Similar topics

14
by: Axel Straschil | last post by:
Hello! Im working with new (object) classes and normaly call init of ther motherclass with callin super(...), workes fine. No, I've got a case with multiple inherance and want to ask if this...
6
by: Jon Hyland | last post by:
Ok, I'm a little rusty on this, it should be a simple problem but I can't figure it out. How can I handle form events in my main code page?? I'm creating a Windows App in C#. Rather than make...
1
by: Mickey Swanson | last post by:
I have a MDI app wich has several different forms I need to call a method on one MDIchild form from another child form. I have a MDI form called frmMDI. I have a mdichild form called frmMain....
5
by: Randy | last post by:
The following code, which runs when I click File->Save in my main form, finds my save button in my mdi child for just fine. The question is: how do I invoke the Save method in the child form? ...
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
5
by: Earl | last post by:
I need to call a method on an owned child form, and am wondering if the best way of doing this is to capture the Closing event of the form that passes control back to the form where I have the...
3
by: fullmetal87 | last post by:
Hi I having a problem with calling the parent method from child form. I am working on an asp .net application. I place the code below under the hyplinkcontrol as the navigation url. And it do open...
1
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
The code below is pretty simple. Calling Talker() in the parent returns "Parent", and calling Talker() in the child returns "Child". I'm wondering how I can modify the code so that a call to the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.