I am really new to Windows Forms programming and not quite sure which way is right for programming.
This is my confusion.
I have one form:
public partial class ReconcilerConsoleWindow : Form { public ReconcilerConsoleWindow() { InitializeComponent(); SetLogText("Started"); } public void SetLogText(String text) { string logInfo = DateTime.Now.TimeOfDay.ToString() + ": " + text + Environment.NewLine; tbx_Log.AppendText(logInfo); } }
And in my Program.cs class, I have the following code:
static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ReconcilerConsoleWindow window = new ReconcilerConsoleWindow(); Application.Run(window); if (CallSomeMethod() == true) { window.SetLogText("True"); } } }
Now that the window has been displayed with the Application.Run command, the program stops at this point. How can I continue processing while the window is up?
The above example. My goal is to read the XMl file and display the datagridview. Subsequently, I look at the XMl file for changes, and every time a change occurs, I want to update the datagridview. However, as soon as the console pops up, how can I continue my program and make changes to the information displayed on the form on the fly?
xbonez
source share