By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,774 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,774 IT Pros & Developers. It's quick & easy.

form.showDialog() does not work properly

P: n/a
Hi

Iam running form2 from form1.
But as it was in many my previous applications, now the form2 doesn't
overlapp form1. It means that i can select form1 without even closing form2.

Here's sample code:

if (MessageBox.Show("Button is not recognized. Would you
like to add function to this button?", "New Button detected",
MessageBoxButtons.YesNo,
MessageBoxIcon.Information) == DialogResult.Yes)
{
Form2 form2 = new Form2();
form2.Button = "b" + t;
form2.ShowDialog();

Fill_DataGrid();
}
May 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"PiotrKolodziej" <pi*************@gmail.com> wrote:
But as it was in many my previous applications, now the form2 doesn't
overlapp form1. It means that i can select form1 without even closing form2.
That's because the form isn't parented.
form2.ShowDialog();


You want the other ShowDialog, the one that takes a parent:

form2.ShowDialog(form1);

-- Barry

--
http://barrkel.blogspot.com/
May 18 '06 #2

P: n/a
Thanks. It works
May 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.