Form failing to load elements correctly when called with Form.Show() – C#.NET


I am trying to make an application that remotely shows and hides a Form using a TcpServer. My code executes this function upon receiving the correct command:

Form2 f= new Form2();

void ShowSplash()
{
   f.Show();
}

When the Form is shown, no elements load, showing a blank screen with the loading cursor.

On Form2
InitializeComponent(); is called, and there is no Load_Event

What I tried:

this.Invoke((MethodInvoker)delegate
{
     f.Show();
});

Something really weird.

When using
f.ShowDialog();

The elements load correctly, and no issues occur, but the code on Form1 halts execution (which is expected) until Form2 closes.

This breaks my head. Help

Leave a Reply

Your email address will not be published. Required fields are marked *