Conveyor_R.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using WCS_Client.Frm;
  11. namespace WCS_Client.From.From_Montior
  12. {
  13. public partial class Conveyor_R : UserControl
  14. {
  15. public Conveyor_R()
  16. {
  17. InitializeComponent();
  18. }
  19. readonly Dictionary<Button, string> dic = new Dictionary<Button, string>();
  20. private void button1_MouseMove(object sender, MouseEventArgs e)
  21. {
  22. string equname = "";
  23. button1.BackColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(144)))), ((int)(((byte)(154)))));
  24. if (Name.Contains("_")) { return; }
  25. dic.Clear();
  26. if (Name.Contains("RGV"))
  27. {
  28. equname = Name;
  29. }
  30. else
  31. {
  32. equname = Name.Substring(3);
  33. }
  34. dic.Add(button1, equname);
  35. MoveOverInfoTip.SettingMutiTipInfo(dic);
  36. }
  37. private void button1_MouseLeave(object sender, EventArgs e)
  38. {
  39. button1.BackColor = Color.Transparent;
  40. }
  41. private void button1_Click(object sender, EventArgs e)
  42. {
  43. if (Name.Contains("_"))
  44. {
  45. MessageBox.Show("该设备无数据。");
  46. return;
  47. }
  48. if (Name.Length > 3)
  49. {
  50. string equname = "";
  51. if (Name.StartsWith("R"))
  52. {
  53. equname = Name.Substring(0);
  54. }
  55. else
  56. {
  57. equname = Name.Substring(3);
  58. }
  59. FrmEquMsg_dtl Frm = new FrmEquMsg_dtl(equname);
  60. Frm.Show();
  61. }
  62. //int index = Name.LastIndexOf('_');
  63. //if (index > 0)
  64. //{
  65. // string equname = Name.Substring(index + 1);
  66. // Form_EquInfo equinfo = new Form_EquInfo(equname);
  67. // equinfo.Show();
  68. //}
  69. }
  70. }
  71. }