void api_LogEvent(object sender, LogEventArgs e) { textBox4.Text += e.Message + Environment.NewLine; //move the caret to the end of the text textBox4.SelectionStart = textBox4.TextLength; //scroll to the caret textBox4.ScrollToCaret(); }
private void OnLogMessage(string message) { EventHandler<LogEventArgs> temp = this.LogEvent; if (temp != null) { LogEventArgs ea = new LogEventArgs(message); Delegate[] il = temp.GetInvocationList(); if (il != null) foreach (EventHandler<LogEventArgs> dgt in il) dgt.Invoke(this, ea); } }