Say I have a login and the main form.
If the login window is closed then the other form shouldn't load.
I tried using a if condition to suppress initializeComponent but it still shows the main form, but empty.
How would you do that?

I would modify the Main method in Program.cs to something like:

static void Main() {
    LoginForm lif = new LoginForm();
    if (lif.Success) {
        Application.Run(new Form1());

You'll need to add a property to your login form (in my example, Success) that lets you know if the user logged in.