private void OnValidateStatus(object sender, ValidationStatusEventArgs e) { if (InvokeRequired) // Make sure to check that if being called from a different thread { this.Invoke(new Action(() => { if (tbStatus.Text.Length + e.Message.Length > tbStatus.MaxLength) // Make sure we dont store too much text to avoid out of memory error { tbStatus.Clear(); } })); } else { if (tbStatus.Text.Length + e.Message.Length > tbStatus.MaxLength) // Make sure we dont store too much text to avoid out of memory error { tbStatus.Clear(); } } }
private void OnValidateStatus(object sender, ValidationStatusEventArgs e) { Console.WriteLine(e.Message); }