Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted (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 by divil

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...