-2

I am currently coding a login Window for my tool.

My tool is made in Form1 while Form2 is my login.

Now while started to debug, for whatever reason it went to Form1 straight.

This is the Beginning code after "namespace".

I tried removing Form2 completely and remaking it, same problem persists though. I have no idea what to do now.

Thanks for any help!

Kapol
  • 6,383
  • 3
  • 21
  • 46
Clark
  • 19
  • 3
  • I edited your title to make it clearer and easier to find an answer to a similar problem in the future. I hope you don't mind. – Kapol Jun 22 '16 at 20:59
  • 1
    `WebClient` needs to be `Dispose()`'ed. You should not make that a class level field, or, you need to handle disposing it when you are done with the form. – Crowcoder Jun 22 '16 at 20:59
  • Name your forms meaningfully. Don't call them Form1 and Form2. Call them LoginForm, MenuForm, MainForm, something like that. Give them appropriate names. And check your Program.cs file to see which is going to be run. Also, check your project's properties for what your startup object is. It should not be set. Or set to Program.cs. – ManoDestra Jun 22 '16 at 21:02
  • You're going to need to know how Program.cs works, otherwise you may encounter further errors when you try to move from your LoginForm to your MainForm. If you find that the program ends upon trying to move from one to the other, then you'll have to code Program.cs differently. E.g. http://stackoverflow.com/questions/4759334/how-can-i-close-a-login-form-and-show-the-main-form-without-my-application-closi – ManoDestra Jun 22 '16 at 21:06

1 Answers1

2

Check the Program.cs class and its Main() method. You probably have such a line there:

Application.Run(new Form1());

Change it to

Application.Run(new Form2());

and you should be good to go.

Kapol
  • 6,383
  • 3
  • 21
  • 46