For opening One or More Windows Form inside another Windows form, a property called "IsMdiContainer" and "MdiParent" is used in below given phasion:
If you are looking for the solution of this error, simply follow below given procedure:
That's all. Your problem will be fixed. If you are facing any other issue, let me know. I will fix that for you.
Most of the times, this code works but users also complains that they get an error "Form cannot be both an MDI child and MDI parent. Parameter name: value". Screenshot of the error screen is given below :using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace Education_Domain{public partial class Form2 : Form{public Form2(){InitializeComponent();IsMdiContainer = true;} private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
Form3 tr = new Form3();
tr.Show();
tr.MdiParent = this;
}
}
If you are looking for the solution of this error, simply follow below given procedure:
Solution of this Problem::
For solving the issue of this problem, Simply add "objectname.MdiConatiner=false;" before the code "objectname.MdiParent=this;". The complete code is given below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Education_Domain
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
IsMdiContainer = true;
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
Form3 tr = new Form3();
tr.IsMdiContainer = false; ---------solution code
tr.MdiParent = this;
tr.Show();
}
}
That's all. Your problem will be fixed. If you are facing any other issue, let me know. I will fix that for you.
I have read some fantastic books on English language that really helped me
improve my writing. You can buy my recommended books on
Amazon. Here is the
lists below:
Books on Grammar:











No comments:
Post a Comment