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; namespace demo8 {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void create NToolStripMenuItem_Click (object sender, EventArgs e) {Form2 fm2 = new Form2 (); fm2.MdiParent = this; // remember to set the IsMdiContainer of the form where this is located to true //. mdiParent = this the current form is the parent form of Form a;. mdiParent = this. mdiParent form a and the parent form of the current form are the same form fm2.Show ();} private void vertically tiled VToolStripMenuItem_Click (object sender, EventArgs e) {LayoutMdi (MdiLayout. tileVertical); // vertical tile} private void stacked ToolStripMenuItem_Click (object sender, EventArgs e) {LayoutMdi (MdiLayout. cascade); // Cascade} private void hToolStripMenuItem_Click (object sender, EventArgs e) {LayoutMdi (MdiLayout. tileHorizontal); // horizontal tile} private void lToolStripMenuItem_Click (object sender, EventArgs e) {foreach (Form childForm in mdichilform) {childForm. close () ;}// Close the subform }}}
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; namespace demo8 {public partial class Form2: Form {public Form2 () {InitializeComponent ();} private void button#click (object sender, EventArgs e) // open the webpage {try {string str = textBox1.Text. trim (); webBrowser1.Navigate (new Uri ("http: //" + str); this. text = str;} catch (Exception ex) {MessageBox. show (ex. message. toString () ;}} private void button2_Click (object sender, EventArgs e) // refresh {webBrowser1.Refresh ();} private void button3_Click (object sender, EventArgs e) // Previous Page {webBrowser1.GoBack ();} private void button4_Click (object sender, EventArgs e) // next page {webBrowser1.GoForward ();}}}