I have a console application that takes in live data from a database, and acts upon it in real time, the bulk of my Main method is within a while(true) loop. I need a form in the background which displays one part of the data that available during the loop. I want it refreshing every time the program completes a loop showing the new value. I've added a form to my project, and added the following code to my initialisation section:
DataDisplay dataDisplay = new DataDisplay();
dataDisplay.Show();
above the Main declaration. This makes the window pop up, but whenever I mouse over it my cursor turns into the Microsoft loading blue circle. The rest of my program runs fine, current functionality remains, just the form isn't happy. Variants of
Application.Run(dataDisplay);
dataDisplay.ShowDialog();
Cause my program to hang on the above lines without progressing to the while loop as the applications doesn't end.
I haven't started building the functionality for populating my form as it doesn't seem to want to behave.
What am I doing wrong, I am relatively new to C# and Winforms both.