Locking a form when another form is opened???
-
Hi, I need the following functionality in my application. I have a main form, from where I display second form to get input to the main form. I want to lock the main form until I get the input from the second form. Can somebody advise me how to acheive this from c#.net windows based application? Thanks Sunitha
-
Hi, I need the following functionality in my application. I have a main form, from where I display second form to get input to the main form. I want to lock the main form until I get the input from the second form. Can somebody advise me how to acheive this from c#.net windows based application? Thanks Sunitha
try this if it help yourformyouwanttoshow.ShowDialog();
ahmed eldeghedy
-
Hi, I need the following functionality in my application. I have a main form, from where I display second form to get input to the main form. I want to lock the main form until I get the input from the second form. Can somebody advise me how to acheive this from c#.net windows based application? Thanks Sunitha
Hello, Have you tried using the
ShowDialog()
method when you are opening the second window from within the form1's code? E.g.:
private void button1\_Clicked(object sender, EventArgs e) { Form SecondForm = new SecondForm(); SecondForm.ShowDialog(); }
This will open the second form on-top of the first form, and the main form cannot be accessed until the second form has been disposed. Hope this helps.
j.t.