private void Monitor_Click(object sender, EventArgs e) { MonitorForm monitor = sender as MonitorForm; FormContainer.Controls.SetChildIndex(monitor, 0); monitor.Activate(); }
private void OpenMonitor(string portName) { MonitorForm monitor = new MonitorForm(portName) { TopLevel = false }; monitor.MinimizeBox = false; monitor.Closing += Monitor_Closing; monitor.Click += Monitor_Click; monitor.Resize += Monitor_Resize; PositionForm(monitor); if (FormContainer.Controls.Count <= 0) { monitor.WindowState = FormWindowState.Maximized; } FormContainer.Controls.Add(monitor); monitor.Show(); FormContainer.Controls.SetChildIndex(monitor, 0); monitor.Activate(); }
private void Monitor_Resize(object sender, EventArgs e) { MonitorForm monitor = sender as MonitorForm; if (monitor.WindowState == FormWindowState.Maximized) { monitor.WindowState = FormWindowState.Normal; monitor.FormBorderStyle = FormBorderStyle.None; monitor.Dock = DockStyle.Fill; current = monitor; } }