Example of MDI in C# (or vb)

anderton

Member
Joined
Jun 26, 2003
Messages
7
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
 
Hi

THe form that opens the child-mdi contains the following code :

C#:
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
 
Last edited by a moderator:
Back
Top