private void Log(string text) { if (InvokeRequired) { var callback = new LogCallback(Log); Invoke(callback, text); return; } LogBox.SuspendLayout(); if (LogBox.Lines.Length >= 100) { LogBox.Lines = LogBox.Lines.Skip(1).ToArray(); } LogBox.AppendText($"[{DateTime.Now:T}] {text}" + Environment.NewLine); LogBox.ResumeLayout(); }