c# - what is the event when a form show -


I have a few buttons such as btnInsertContact, btnInsertEmployemant, ... for MainForm ... < p> For example when users click btnInsertContact, another form will be displayed that the user should enter their contact information in it. But the mainframe can not be closed.

I want an event that closes with the user's contact form, then it is of happiness.

With this code, the contact form will be shown, but the mainform should not be closed.

  Private Zero btnInsertContact_Click (Object Sender, EventArgs e) {frmContact.ShowDialog (); }   

I want to update some information in the mainframe after closing the contact form.

I tried the load event but this is not true because my main form did not stop

I tried the event but it could not work, I do not know Why

Which events do I want?

If you want to get value from the contact form, then you should modify the controls for public < / P>

  // main form // first method private zeros btnInsertContact_Click (object sender, event erggs e) {frmContact.FormClosed + = new event handler (ContactForm_Closed); frmContact.ShowDialog (); } Private Zero ContactForm_Closed (Object Sender, EventArgs E) {// ur code here}} // Second Way Private Zero btnInsertContact_Click (Object Sender, EventArgs e) {frmContact.ShowDialog (); Enter ur code here. }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -