Controlling activeChild form from MdiParent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am developing a MDI application where I would like to be able to control
the activeChild form from buttons on the MdiParent toolbar.

For example navigate through records in the dataset of the activeChild form.
I would like to use the same buttons on the MdiParent tool bar for any
activeChild form that is open.

How would I accomplish this? (C#/C++ please)

Thanks,
JoseTA
 
JoseTA said:
I am developing a MDI application where I would like to be able to control
the activeChild form from buttons on the MdiParent toolbar.

For example navigate through records in the dataset of the activeChild
form.
I would like to use the same buttons on the MdiParent tool bar for any
activeChild form that is open.

\\\
if (!(this.ActiveMdiChild == null))
((FooForm)this.ActiveMdiChild).TextBox1.Text = "Hello World!";
///
 
Thankyou for the help.

Using this source code we would access the child form controls from parent
window. But I need to access from child form to get parent windows toolbar
click event. For example, Child form having a database records and want to
navigate through parent toolbar click event. How it is possible? Could please
help me?

Thanks
JoseTA
(e-mail address removed)
 
Hi Kevin and ALL

I did Menu Merge and working with menu fine. But What I am asking about
parent toolbar click event. How to merge these controls to child form.

Thanks
JoseTA
 
Hi JoseTA,

OK, correct me if I'm wrong here. Do you have the toolbar on the Parent form
already, but you want the child forms that get loaded, to subscribe to the
Parent forms toolbar's button click event, and handle the event in the child
window?

If so, what you may need to do, is create a public property in the MDI
parent that exposes the toolbar control, and in the child form's load event,
get it's parent like so :
MDIForm parent = (MDIForm)this.ParentForm

then you can use this "parent" object to get the toolbar from the public
property that you've written in the MDI Form, to get the click events. Once
you've got this its simple to subscribe to the parents' toolbars events.
something like :

parent.ParentToolbar.ButtonClick += new
ToolBarButtonClickEventHandler(ParentToolbar_ButtonClick);

where ParentToolbar is the public property.

Hope I interpreted you problem correctly, if not let me know and I'll give
it another shot ;)

Kevin
 
Hi Kevin

I am not much familiar with C# so can you make it C++. If you give detailed
example I will be more happy.

Thankyou
JoseTA
 
Back
Top