473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get a proper login screen

2
Hey, I recently started with C# and I've done some things in XNA, 2D and 3D etc but now I'm trying to start with window programming.

Atm I've done a program who start a normal form where you enter your username and password, when you press ENTER your information will be checked and it will close the login menu and open a new form named CSystem.

I'm trying to get it to work like this

When I enter the program I'll get a login screen, when I enter my user/pass etc and press ENTER I want it to check the information and instead of close and open a new form I want everything, all labels etc, in the login form to "disappear" and new stuff will be on the screen.

Like when you play a game hmm, lets say World of Warcraft, when you enter your login information the program won't close and open a new window if you understand what I mean.

If you know any good tutorials or anything else please leave a comment.

Sorry for my bad English :(

//grateful for answer
May 30 '10 #1
3 2363
ThatThatGuy
449 Expert 256MB
When you show the Main Form after the login screen...
means. when you do something like this

Expand|Select|Wrap|Line Numbers
  1. Form2.Show();
  2.  
Close the current form (Login form) by doing this

Expand|Select|Wrap|Line Numbers
  1. this.Close();
  2.  
May 31 '10 #2
Twizz
2
I've already tried this but it won't load in the same WINDOW, it still closes the form and start a new one, maybe I'm way out of line and maybe I shouldn't use FORM at all.

Maybe I need to use DMI containers but I don't think so, just trying to get everything in the same window, like in JAVA you can clear the window and call method to write out the new stuff instead of open a new form.
May 31 '10 #3
GaryTexmo
1,501 Expert 1GB
Well, you should be able to open another form on top of your current form to handle the login. You can set up events to pass information between your login form and your main form.

That said, I know what you mean when you describe it as the WoW login form. Try designing both your login form and main forms as a UserControl object. When your program starts up, add the login control to the main form. When login is successful, pass a message to the parent control (ie, the main form) to tell it to remove the login control and put in the main gui controls.

Something like this...

Expand|Select|Wrap|Line Numbers
  1. public void MyForm() { this.Controls.Add(new LoginControl()); }
  2.  
  3. public void SuccessfullLoginEvent(object sender, EventArgs e)
  4. {
  5.   this.Controls.Clear();
  6.   this.Controls.Add(new MainGUIControl());
  7. }
May 31 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Chip | last post by:
I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the login button is pushed (or the enter key pressed) the...
3
by: Steve | last post by:
I am new to .Net and Visual Studio, I have a login form and my main application form. When I login I want to call the application form, and dispose of the login. I have tried doing something...
0
by: Bassem | last post by:
Hi All, I had problem when using Crystal Report in C# windows application. I create report depend upon dataset using table from SQL 2000 and add it in a C# windows application. NP: The...
6
by: Marty | last post by:
What is the best way do a login screen? I have the Main() method in my login screen. After iit checks the userid and password the OK button loads the main application form but the next line is...
0
by: JIM.H. | last post by:
Hello, My connection string in config.web: <appSettings> <add key="connStr" value="workstation id=myServer;packet size=4096;user id=MyUser;data source=MYSERVER;persist security info=True;initial...
2
by: john andrew | last post by:
-- hello After installing VB.net standard and using Access with it. I know get a login screen with WinXP(home) after it has been idle after a while . It gives a admin message (and you just...
9
by: dana lees | last post by:
Hello, I am developing a C# asp.net application. I am using the authentication and authorization mechanism, which its timeout is set to 60 minutes. My application consists of 2 frames - a...
1
by: leovega | last post by:
Hello, My aplication starts with a simple login window (login_page.aspx). Once the login/password is validated I redirect to an html which contains 3 frames. (mywebsite.html) The web site I...
1
by: Ted Ngo | last post by:
Hi All, I try to create a login screen using mode="Forms" Web Config: <authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="Login.aspx" protection="All" timeout="30" path="/"
3
by: bala | last post by:
Hi Gurus The scenario A MS Access frontend application with Oracle Backend (Linked Tables). The Database UserID and password is not stored and each user has a unique UserID and password. There...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.