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();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top