Hey

I need to create a simple login.
The question isn't actually that much about creating the login but about creating 2 views.
One for the user who hasn't logged in, the other who is logged in.

1.The user starts program, the panel1 with login is displayed.
2. The user logs in and the panel1 is hided, panel2 is set visible.

The previous flow is how I'd do it.
But working on it is tedious, since one panel could be accidentaly dropped in the other.

How these things are done?
How would you do it, with panels or smth else?

Thank you

What if you'd have 1 pannel for logged user and a separate popup window for a user to log in? Can the 'non-logged' user somehow interact with your system (except entering his/her login data)?

Create a separate log in window, and use ShowModal() to process it. They won't be able to interact with anything other than the log in window until you close it.

The users can't see and interact with anything else then the log in.
So you suggest I'd use 2 forms?

Ok, in your case, you can't call the Login form as equipollent view as a view for a logged user. Let me provide you with an example .. there're could be views, if you'd telling about (strongly) different functionality for a few groups of users. E.g. like a customers and sellers, who're using same software for different purposes. So, we can talk about the views as a different sides of one medal.

In your case it's rather states, than views. User is making some steps to get somewhere .. in your case he's logging in to get e.g. to it's control panel.

Assuming that, it would have more sence in making a form for a logged user as a fully-functional view, and the login form as a, say "supporting tool". You can make it as a popup window, or a smoothing panel above the main view .. there plenty of different variants, just look at web logging mechanisms (it provides more different examples, rather than desktop software), and decide, what you want to have in your prog.

Yes after thinking the view is something different, like in SQL.
I am relatively new to C# forms, however I have some experience with other visual interfaces mostly webrelated.

So I want something more like step-by-step or example.
I mean how could I do it with popup, since the main form gets loaded before.
Hide(), show() should I use these?

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.