0% found this document useful (0 votes)
7 views2 pages

Menu

The document is a C# code snippet for a Windows Forms application that defines a main MDI (Multiple Document Interface) parent form. It includes methods to close child forms, exit the application, and open new forms (frmAccueil and frmVille) while maximizing them. The form's size is set to match the screen dimensions upon loading.

Uploaded by

ndellasokeng129
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Menu

The document is a C# code snippet for a Windows Forms application that defines a main MDI (Multiple Document Interface) parent form. It includes methods to close child forms, exit the application, and open new forms (frmAccueil and frmVille) while maximizing them. The form's size is set to match the screen dimensions upon loading.

Uploaded by

ndellasokeng129
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.VisualBasic.Devices;

namespace FirstWinform
{
public partial class frmMdiParent : Form
{
public frmMdiParent()
{
InitializeComponent();
}
private void fermer()
{
Form[] charr = this.MdiChildren;

//For each child form set the window state to Maximized


foreach (Form chform in charr)
{
//chform.WindowState = FormWindowState.Maximized;
chform.Close();
}
}
private void quitterToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void accueilToolStripMenuItem_Click(object sender, EventArgs e)


{
fermer();
frmAccueil f = new frmAccueil();
f.MdiParent = this;
f.Show();
f.WindowState = FormWindowState.Maximized;
}

private void villeToolStripMenuItem_Click(object sender, EventArgs e)


{
fermer();
frmVille f = new frmVille();
f.MdiParent = this;
f.Show();
f.WindowState = FormWindowState.Maximized;
}

private void frmMdiParent_Load(object sender, EventArgs e)


{
Computer myComputer = new Computer();
this.Width = myComputer.Screen.Bounds.Width;
this.Height = myComputer.Screen.Bounds.Height;
this.Location = new Point(0, 0);
}
}
}

You might also like