private void btnDoPrimeThing_Click(object sender, System.EventArgs e) { Class1 class1 = new Class1(); class1.OnPrime += new Class1.OnPrimeEventHandler (this.Class1_OnPrime); for (long i=1; i <= 100; i++){ class1.IsPrime (i); } }