Hello, I have 3 forms
1. frmparent (MDIcontainer)
2. frm_com_sel
3. frm_com_add
I have to load a frm_com_sel on frmparent's load event as dialog box so that no other form can be loaded at that time
I have one button bt_add , on click of that button, i want to load frm_com_add as child form in frmparent (MDIcontainer).
frmparent's Load event code :
private void frmparent_Load(object sender, EventArgs e)
{
frm_com_sel ch_com = new frm_com_sel()
ch_com.ShowDialog()
}
In above code, i'm not able to set MDIparent for ch_com
here is the code for bt_add button on frm_com_sel :
private void bt_add_Click(object sender, EventArgs e)
{
frm_com_add ch_com = new frm_com_add();
ch_com.MdiParent = PatelIndustries.frmparent.ActiveForm>
ch_com.Show();
ch_com.WindowState = FormWindowState.Maximized;
this.Close();
}
Problem here is in bold part of the above code... help me out with that line...
or If I load frm_com_sel as childform in frmparent then this problem is solved but I don't want any other form to be accessed from frmparent (MDIcontainer), so like if it tries to lose focus, its focus comes back to it...
Thanks in advance, hoping for some help...