private void Form1_Load(object sender, EventArgs e) { foreach (Control c in this.Controls) c.Enabled = false; Connectez ConnectezFrm = new Connectez { TopMost = true, Owner = this }; ConnectezFrm.Show(); }
Connectez.cs :
private MainFrm objMainfrm { get; set; } public Connectez(MainFrm objfrm) { objMainfrm = objfrm; InitializeComponent(); } .... .... private void simpleButton1_Click(object sender, EventArgs e) { foreach (Control c in objMainfrm.Controls) c.Enabled = true; this.Close(); }