using System.Drawing; using System.Reflection.Emit; using System.Windows.Forms; namespace WindowsFormsApp2 { public partial class displayResult : UserControl { public displayResult() { InitializeComponent(); singleCam1.callback = callback; singleCam2.callback = callback; singleCam3.callback = callback; singleCam4.callback = callback; singleCam5.callback = callback; singleCam6.callback = callback; singleCam7.callback = callback; singleCam8.callback = callback; } void callback(int id) { FullScreen dial = new FullScreen(); if (id > -1) { dial.bindCam(id); dial.Show(); } } public void init() { singleCam1.setCamId(0); singleCam2.setCamId(1); singleCam3.setCamId(2); singleCam4.setCamId(3); singleCam5.setCamId(4); singleCam6.setCamId(5); singleCam7.setCamId(6); singleCam8.setCamId(7); } public void close() { singleCam1.closeSocket(); singleCam2.closeSocket(); singleCam3.closeSocket(); singleCam4.closeSocket(); singleCam5.closeSocket(); singleCam6.closeSocket(); singleCam7.closeSocket(); singleCam8.closeSocket(); userControl11.closeSocket(); } } }