Good evening everyone,
I want to close a MDI and all het children from inside an child.
Is this possible?
this.Close() doesn't work.
Close MDI by child
Started by Keuvie, Jul 28 2008 09:35 AM
17 replies to this topic
#1
Posted 28 July 2008 - 09:35 AM
|
|
|
#3
Posted 28 July 2008 - 10:51 AM
Thanks
#5
Posted 28 July 2008 - 10:57 AM
This text is in a child and doesn't close the Parent, BUT when this.Close(); is this.Mdiparent.close(); it does work
private void btnOk_Click(object sender, EventArgs e)
{
if ((tbPass.Text == PasswordReal) && (tbUser.Text == UsernameReal))
{
this.Close();
}
else
{
{
DialogResult result = MessageBox.Show("Username and/or Password are incorrect. Enter again?", "Incorrect", MessageBoxButtons.RetryCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Retry)
{
tbPass.Text = "";
tbUser.Text = "";
}
else if (result == DialogResult.No)
{
this.MdiParent.Close();
}
}
}
#7
Posted 28 July 2008 - 11:01 AM
uhm, nothing :P
#8
Posted 28 July 2008 - 11:08 AM
#9
Posted 28 July 2008 - 11:14 AM
When there is no password i get your messagebox
private void btnOk_Click(object sender, EventArgs e)
{
if ((tbPass.Text == PasswordReal) && (tbUser.Text == UsernameReal))
{
this.Close();
}
else
{
MessageBox.Show("Xav's line of code was the problem.");
this.MdiParent.Close();
/*DialogResult result = MessageBox.Show("Username and/or Password are incorrect. Enter again?", "Incorrect", MessageBoxButtons.RetryCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Retry)
{
tbPass.Text = "";
tbUser.Text = "";
}
else if (result == DialogResult.No)
{
}*/
}
#11
Posted 28 July 2008 - 11:20 AM
i get your messagebox and then it closes the parent


Sign In
Create Account


Back to top









