I'm fairly new to c# and im trying to create a windows form application made up of 3 pages. The first, a login page, the second, a search page, and the third will be a page to fill in some fields to save the info to a database.
My problem is that i can not manage to transfer control from one page to another, that is, when the program launches, i can not get it so that it directs control to the login and then the use presses the login button, they are displayed the second page, which is the search page.
After having coded in java for a few years, i know that if this were a java application, all i would have to do is set the current thread of control to a frame and dispose of the previous frame, if you wish. My troubles in C# is that in using Web Forms, i can not seem to transfer control from one .cs file to another.
this is what i have tried:
By default, the windows forms creates a Form1.cs which is the entry point of the program. In the Form1() where it is supposed to call initiate(), i changed that to call my own login class:
Expand|Select|Wrap|Line Numbers
- public Form1()
- {
- InitializeComponent()
- }
Expand|Select|Wrap|Line Numbers
- public Form1()
- {
- new Login();
- }
So, my question is the following:
how to do i create my application so that the entry point is through Form1, but then call Login() and my subsequent pages?
thanks, any guidance will be much appreciated.