change Form *Form1 = new Form(); to Form1 *frm = new Form1();