i need help with windows form, i am working in one win application, so what i need, ex. i have form which is name MainForm, and i have another form which is for user login named Loginform, what i need is when i execute a project i need that login page form to be showed up first and after the user is loged in, than to show up the Main form.
Change start up from property of application set your login form instead of Main Form. after this make object of main form in login page and show that form.If you want to send anything from login page to main form make parameter for that and pass them.
Simpliest way to do so, it touse ShowDialog method:
//in the main form:
using(Login log = new Login())
if(log.ShowDialog() == DialogResult.OK)
//in login form:
//when you do all the checking on the user`s name and password
//and all is OK, do:
this.DialogResult = DialogResult.OK;