anderton Posted June 26, 2003 Posted June 26, 2003 Hi I am new to .net/C# development and I am looking for some example code using MDI. I have already searched this board and found a lot of usefull information but would still like some C# code examples. I would like to end up with a mdi-container from where I can open x mdi-children forms and be able to pass references to properties and methods. In the code I have made so far I have used : mdiBasics.mdiChild child = new mdiBasics.mdiChild(this); //MessageBox.Show(this.stringForParentTest); child.MdiParent = this; child.Show(); But I have a problem using the MdiParent reference from the child-mdi I create. Can anyone help me with som examples of how I get this working or even better got and mdi-application they can send me with just the basic things needed. Hope somone can help Cheers Anderton Quote
*Experts* mutant Posted June 26, 2003 *Experts* Posted June 26, 2003 What is the problem with MdiParent property? Quote
anderton Posted June 27, 2003 Author Posted June 27, 2003 (edited) Hi THe form that opens the child-mdi contains the following code : using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace mdiBasics { /// <summary> /// Summary description for Form1. /// </summary> public class mdiContainer : System.Windows.Forms.Form { private static System.Windows.Forms.Form _MDIWindowContainer = null; private System.Windows.Forms.Button btnOpenNewMdiWindow; public String stringForParentTest = "Alles ok"; From the child-mdi window I would like to access i.e the string stringForParentTest . I have tried many differet things but nothing seems to work. I.e how do I show a messagebox in the child-mdi with the string stringForParentTest ? Thanks Anderton Edited June 27, 2003 by divil Quote
*Experts* mutant Posted June 27, 2003 *Experts* Posted June 27, 2003 You could cast the MdiParent property to the type of your form and then you could access the string. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.