/// <summary> /// Update text with message color defined as green/yellow/red/ for success/warning/failure /// </summary> /// <param name="Text">Message</param> /// <param name="tom">Type of Message</param> public static void UdpateStatusTextWithStatus(string Text, Config.TypeOfMessage tom) { if (sf != null) { sf.UdpateStatusTextWithStatus(Text, tom); } }
/// <summary> /// Update text with message color defined as green/yellow/red/ for success/warning/failure /// </summary> /// <param name="Text">Message</param> /// <param name="tom">Type of Message</param> public void UdpateStatusTextWithStatus(string Text, Config.TypeOfMessage tom) { if (InvokeRequired) { // We're not in the UI thread, so we need to call BeginInvoke BeginInvoke(new StringParameterWithStatusDelegate(UdpateStatusTextWithStatus), new object[] { Text, tom }); return; } // Must be on the UI thread if we've got this far switch (tom) { case Config.TypeOfMessage.Error: lblInfor.ForeColor = Color.Red; break; case Config.TypeOfMessage.Warning: lblInfor.ForeColor = Color.Yellow; break; case Config.TypeOfMessage.Success: lblInfor.ForeColor = System.Drawing.ColorTranslator.FromHtml("#C2B49A"); break; } lblInfor.Text = Text; }