using System; using System.Windows.Forms; namespace MonoTest32 { class Form12 : Form { static void Main () { Application.Run (new Form12 ()); } Button b; ErrorProvider ep; public Form12 () { ep = new ErrorProvider (); b = new Button (); b.Click += new EventHandler (b_Click); Controls.Add (b); } void b_Click (object sender, EventArgs e) { ep.SetError (b, "Error"); } } }