Conveyor_L.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_L : UserControl
  14. {
  15. public Conveyor_L()
  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. button1.BackColor = Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(144)))), ((int)(((byte)(154)))));
  23. if (Name.Contains("_")) { return; }
  24. dic.Clear();
  25. string equname = Name.Substring(3);
  26. dic.Add(button1, equname);
  27. MoveOverInfoTip.SettingMutiTipInfo(dic);
  28. }
  29. private void button1_MouseLeave(object sender, EventArgs e)
  30. {
  31. button1.BackColor = Color.Transparent;
  32. }
  33. private void button1_Click(object sender, EventArgs e)
  34. {
  35. if (Name.Contains("_"))
  36. {
  37. MessageBox.Show("该设备无数据。");
  38. return;
  39. }
  40. if (Name.Length > 3)
  41. {
  42. string equname = Name.Substring(3);
  43. FrmEquMsg_dtl Frm = new FrmEquMsg_dtl(equname);
  44. Frm.Show();
  45. }
  46. //int index = Name.LastIndexOf('_');
  47. //if (index > 0)
  48. //{
  49. // string equname = Name.Substring(index + 1);
  50. // Form_EquInfo equinfo = new Form_EquInfo(equname);
  51. // equinfo.Show();
  52. //}
  53. }
  54. }
  55. }