FormNumberMachinePreview.cs 923 B

1234567891011121314151617181920212223242526272829303132333435
  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.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace centralController
  11. {
  12. public partial class FormNumberMachinePreview : Form
  13. {
  14. TableLayoutPanel tlp;
  15. PictureBox pb;
  16. public FormNumberMachinePreview(string title,PictureBox pb,TableLayoutPanel tlp)
  17. {
  18. InitializeComponent();
  19. this.Text = title;
  20. pb.Dock = System.Windows.Forms.DockStyle.Fill;
  21. Controls.Add(pb);
  22. this.tlp = tlp;
  23. this.pb = pb;
  24. }
  25. private void FormNumberMachinePreview_FormClosing(object sender, FormClosingEventArgs e)
  26. {
  27. if (tlp != null && pb != null)
  28. {
  29. tlp.Controls.Add(pb, 0, 1);
  30. }
  31. }
  32. }
  33. }