Form called from another thread doesn’t show up

The code bellow is inside a thread. This is a solution I found online, but it doesn't work. Clearly I am doing something wrong, so please help me with this.

PrivatnaSoba privateroom = new PrivatnaSoba(privateRoomPort); privateroom.Show(); privateroom.Hide(); this.Invoke(new MethodInvoker(delegate() { privateroom.TopMost = true; privateroom.Show(); })); 

by mori170 via /r/csharp

Leave a Reply