open Form

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hi,

How to open a form with onClick event in VS 2005? I tried this
private void frmSplash_Click(object sender, EventArgs e)

{

Form frmLogin = new Form();

frmLogin.Show();

frmLogin.Activate();


}



It opened me a blank form.



Thanks
 
You need to create an instance of the proper class that you derived from
Form. It looks like you're currently creating an instance of the generic
Form class.

public class MyForm : Form
{
...
}

....

MyForm f = new MyForm();
f.Show();
 
Back
Top