I have a tab in my GUI I would like to be an auto-updating dev log. It currently only updates the initial time. How do I update this.devLogRichTextBox.Text with every change in DevLog.DevLog.log?
//
// devLogRichTextBox
//
this.devLogRichTextBox.Location = new System.Drawing.Point(3, 3);
this.devLogRichTextBox.Name = "devLogRichTextBox";
this.devLogRichTextBox.Size = new System.Drawing.Size(1195, 368);
this.devLogRichTextBox.TabIndex = 0;
this.devLogRichTextBox.Text = DevLog.DevLog.log; // This doesn't do what I want. This sets the text one time to string DevLog.DevLog.log
I would like to add lines to this log from anywhere in the program:
namespace DevLog
{
public static class DevLog
{
public static string log = "Default";
public static void addToLog(string addition)
{
log += addition + "\r\n";
}
public static void clearLog()
{
log = "";
}
public static void dumpLogToFile()
{
//Dump log to a file on HD
}
public void updateGUIDevLog()
{
//??
}
}
}
I have tried some things with pointers, but maybe the best option is to have it update at a fixed interval, or better yet, invoke some sort of update whenever a modification is made.