I create a simple form that pops up a dialog box when you run it, but i cannot close it programmatically. Can anyone help me with that?
Label lb = new Label();
Form frm = new Form();
lb.Left = 100;
lb.Top = 44;
frm.Controls.Add(lb);
frm.ShowDialog();
System.Threading.Thread.Sleep(2000);
After ..Sleep(2000) i want it to close. I tried:
frm.close();frm.dispose();frm.visible = false;
Thanks in advance!