I'm trying to write a fully functional program for my class. Its a make up for a missed midterm. Its a simple database program. I want it to start by asking for a user name and password then once that is compared to whats in the database. If found it closes the login window and shows the main menu were you can add stuff to the database remove stuff from it (ex. find a class and sign up for it, remove yourself from a class, etc...). BUT I'm having so many problems with it. I have everything technically working, I have classes that connect to the database I can add, remove, modify, and what not. I'm having problems implementing it all how do I have just the login form appear and then disappear when someone logs in. Then show a main form, where most of this stuff happens. Maybe another form to do something else. I've tinkered with static variables in a class (so there like global variables), but I've found out that's not a good way to program.

what my question boils down to is, I can't find any examples of how to properly program a program. So I just lost on how to do this the correct way.

I can't find any examples of what I should do. Any help would be appreciated