ShowMsg.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm;
  10. namespace Core.StlMes.Client.LgResMgt.Mcms
  11. {
  12. public partial class ShowMsg : UserControl
  13. {
  14. public ShowMsg()
  15. {
  16. InitializeComponent();
  17. }
  18. public void Clear()
  19. {
  20. uteMsg.Value= "";
  21. }
  22. public void AddMsg(string msg)
  23. {
  24. AddMsg(msg, true, false, false);
  25. }
  26. public void AddError(string msg)
  27. {
  28. AddMsg(msg,true,false,true);
  29. }
  30. public void AddMsg(string msg, bool addTime ,bool bold, bool showRedText)
  31. {
  32. StringBuilder sb = new StringBuilder();
  33. sb.Append(
  34. "<span style=\"color:Blue; font-family:Arial; font-style:italic;\">" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</span>");
  35. sb.Append("<br/>");
  36. sb.Append("<span style=\"font-family:宋体;" + (bold ? "font-weight:bold; " : "") + (showRedText ? "color:Red; " : "") + " font-size:+3pt;\">" + msg +
  37. "</span>");
  38. sb.Append("<br/><br/>");
  39. if(uteMsg.Value.ToString3().Length <= 50000)
  40. sb.Append(uteMsg.Value.ToString2());
  41. uteMsg.Value = sb.ToString();
  42. }
  43. }
  44. }