Hello
How to prevent second opened form from closing when user types in main form?User typing in first form will watch second form fields dynamically.
Thanks in advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Nov 24, 2014, 3:52 AM EST
Posted Nov 24, 2014, 4:06 AM EST
VulpesRank #55 · 29.2K reputationPosted Nov 24, 2014, 4:27 AM EST
But, if you handle its Resize event as follows, it should pop-up again if there's any attempt to minimize it:
Selva GanapathyRank #560 · 4.3K reputationPosted Nov 24, 2014, 7:14 PM EST
Hi llkin turk.
Hope you are trying to prevent closing until the user actually wish to close. for that you can handle the closing event
using the following code snippet.
void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
if(!(form1 as Form1).checkBox1.Checked)
e.Cancel = true;
}
Regards,
Selva Ganapathy K