Using c# winforms, I'm trying to make a sort of overlay. Here's what I'm testing with:
Main window has this code:
OverlayThread = new Thread(DisplayOrderOverlay);
OverlayThread.Start();
private void DisplayOrderOverlay(object obj)
{
ActiveOrderOverlay AOA = new ActiveOrderOverlay();
AOA.StartLoop();
AOA.ShowDialog();
}
And the overlay is just a list box on a form with this code:
public void StartLoop()
{
while (true)
{
Thread.Sleep(500);
Random r = new Random();
listBox1.Items.Add(r.Next().ToString());
this.Refresh();
}
}
I never even see the overlay, but if I pause, the loop is running.