|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Enable a windows form over another one?I want to disable a form after opening a new one in front of it and i use the
enable property for this as Form4 newForm = new Form4(); newForm.Show(); this.Enabled = false; But how can I enable the the previous form over the new form after the job is finished with the new form that I opened. -- hard can be achieved! impossible takes a little time! "panda" wrote: one way is to include a reference in the new form to the old form. (assuming > I want to disable a form after opening a new one in front of it and i use the > enable property for this as > > Form4 newForm = new Form4(); > newForm.Show(); > this.Enabled = false; > But how can I enable the the previous form over the new form after the job > is finished with the new form that I opened. > old form is of type Form3: public class Form4{ Form3 owner; public Form4(Form3 caller){ owner = caller; } public void OnClose(yadayadayada){ owner.Enabled = true; } } In the current form close event or in the Exit button enable the first form
like, private void Form4_Closed(object sender, System.EventArgs e) { { Form1 oldForm = new Form1(); oldForm.Enabled=true; oldForm.Show(); } Cheers, Daya Show quoteHide quote "panda" wrote: > I want to disable a form after opening a new one in front of it and i use the > enable property for this as > > Form4 newForm = new Form4(); > newForm.Show(); > this.Enabled = false; > But how can I enable the the previous form over the new form after the job > is finished with the new form that I opened. > > -- > hard can be achieved! > > impossible takes a little time!
Other interesting topics
A challenge to all MVP's.......GET A J.O.B. for once in your life
Windows service Unable to access mapped drives on XP and 2003 Boxe Strange Excel importing problem How to do simple memcpy in C#? Text Files, Encoding and NewLine character My application works fine in debug mode but does not work in release mode. Parameter Methods Performance (val,ref,out) Simple architecture question. Finalize Queue (WinDBG / SOS) Detecting overriding with reflection? |
|||||||||||||||||||||||