FrmPLC.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace PCLCommunication
  10. {
  11. public partial class FrmPLC : Form
  12. {
  13. public FrmPLC()
  14. {
  15. InitializeComponent();
  16. }
  17. public DataRow Item
  18. {
  19. get;
  20. set;
  21. }
  22. private void btnOK_Click(object sender, EventArgs e)
  23. {
  24. Item["IP"] = this.txtIP.Text.Trim();
  25. Item["Port"] = Convert.ToInt32(this.txtPort.Text.Trim());
  26. Item["Interval"] = Convert.ToInt32(this.txtInterval.Text.Trim());
  27. this.DialogResult = DialogResult.OK;
  28. this.Close();
  29. }
  30. private void FrmPLC_Load(object sender, EventArgs e)
  31. {
  32. this.txtIP.Text = Item["IP"].ToString();
  33. this.txtPort.Text = Item["Port"].ToString();
  34. this.txtInterval.Text = Item["Interval"].ToString();
  35. }
  36. private void btnClose_Click(object sender, EventArgs e)
  37. {
  38. this.DialogResult = DialogResult.Cancel;
  39. this.Close();
  40. }
  41. }
  42. }