this.GotFocus += new System.EventHandler(this.Form1_GotFocus); private void Form1_GotFocus(object sender, EventArgs e) { MessageBox.Show("wazaa"); }