I am playing with c# this past week, because i want to learn this language.
Now i have a question about my with my program.
First i have a 1 MDIparent form and 1 MDIchild form with one text box on it, then in the MDIparent I used a ribbon bar on it now i have also one button on the ribbon bar in the parent form, now what i want to do is that when the MDIChild form activated then i will type a text on the textbox on the childform after that i will click the button on the ribbon bar on the MDIparent form then after clicking on it a messagebox will appear with the text I input on the Child form. I already played on mdi parent and child but i cant find the solution on the text that will bypass from mdi child to mdi parent.
I will appreciate for any help will come. thank you
i was expecting that when i clicked the button on the parent form it will show me the message what i typed on the child form through the message box on the parent form. i have no idea why i will get an empty string on the message, the message box doesn't show any message.
I also tried to set the modifier of the text box into public but still i cant access it to another form on the parent form.
Hello, ZER09. Public property is enough to get this working. I've tried, and it displayed all I wanted. Can't say why yours is acting wrong. Can you provide a code, where you add a child form to a parent MDI container?
@antenka thank you i already solve the problem. but i have another problem
here is the scenario:
now the scenario is that, there is two child form opened and both of them has a textbox and both of the textbox has a text or a data(string), then only one of the child forms are active and the other one is inactive. now when i clicked the button or menu in the parent form, only the text from the textbox of the active child form will be shown (example in the messagebox), and the text from the inactive child forms will be disregard.
public static string teststring = "";
public string a // this will be called by the child form
teststring = value;
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
//it will now show the data
for the child form
private void studentIDtextEdit_EditValueChanged(object sender, System.EventArgs e)
// at this point it will send the data to the parent form
mainform mnf = new mainform();
mnf.a = studentIDtextEdit.Text;
all the modifier is set to private
Take a look at Determining the Active MDI Child
i cant understand it so will, can you please give more hint about it