if (txt_Output.InvokeRequired == true){ txt_Output.Invoke(new MethodInvoker(delegate () { txt_Output.AppendText(msg); }));}else{ txt_Output.AppendText(msg);}