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

Causing button_click in a child from a menu strip item of MDI parent

Hi,
Please anyone who could help me implement this requirement:

From the parent's menu strip item I need to cause a button_click event in one of the child.

In my MDI Parent I have this code:

private void formCToolStripMenuItem_Click(object sender, EventArgs e)
{

mdiFormA obj = new mdiFormA();
obj.btnFormA.Click += new System.EventHandle formCToolStripMenuItem_Click);

}



In the target MDI child that is mdiFormA, I have made the following modification:

public System.Windows.Forms.Button btnFormA;

public void btnFormA_Click(object sender, EventArgs e)
{

MessageBox.Show("Button Clicked");

//further code goes here to open mdiChildC later on with certain conditions

}


mdiFormA is already opened before the menu item click, but this arrangement is not working, Please if anyone could help me out with this, it will be appreciated a lot.

Thanks in advance.
Apr 8 '07 #1
1 1086
Motoma
3,237 Expert 2GB
Since btnFormA_Click is public, you don't need the child form to register the button as being clicked, you can just call the function directly from inside your hanlder.
Apr 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: PK | last post by:
Hi, I've a MDI form and a child form that comes from a dll. Everything works fine until I had to uncheck or check a menu item in the MDI form based on the changes in the child form. How to acheive...
0
by: Karthick Kumar | last post by:
Hi, I need to create a simple parent/child hierarchical menu. I have alread used the Treeview control but my requirement is slightly different than the Treeview control. I already have the kind...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
0
by: sandeepthoppil | last post by:
Hi I dont know whether I am doing something wrong here. But this is very strange thing I have noted with menu strip control. I am using VB 2005. I am using a menu strip control as the main menu...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.