using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace KHPANEL { public partial class Form_Main : Form { FormHTPanel_1 Screen01; public Form_Main() { InitializeComponent(); Screen01 = new FormHTPanel_1(); ScreenDetect(); } private void ScreenDetect() { Screen[] sc = Screen.AllScreens; if (sc.Length > 1) { ucScreen1.SetScreen(sc, 1); ucScreen1.SetScreen(sc, 2); //Screen screen = (sc[0].WorkingArea.Contains(this.Location)) ? sc[1] : sc[0]; //frm.Show(); //frm.Location = screen.Bounds.Location; //frm.WindowState = FormWindowState.Maximized; } } private void simpleButton_1_Click(object sender, EventArgs e) { //MessageBox.Show(ucScreen1.m_SelectIndex.ToString()); if(Screen01==null || Screen01.IsDisposed) { Screen01 = new FormHTPanel_1(); } Screen[] sc = Screen.AllScreens; Screen screen = sc[ucScreen1.m_SelectIndex]; Screen01.Show(); Screen01.Location = screen.Bounds.Location; Screen01.WindowState = FormWindowState.Maximized; } private void timer_DBConnect_Tick(object sender, EventArgs e) { try { if (!DBConnectionSingleton.Instance().isConnect()) if (DBConnectionSingleton.Instance().Connect()) { textBox_State.Text = "DB_Connected\r\n"; //panel_DBConnect.BackColor = Color.FromArgb(192, 255, 192); } else { //panel_DBConnect.BackColor = Color.FromArgb(255, 192, 192); } } catch (Exception ex) { textBox_State.Text = "DB_Connected Error\r\n"; } } private void button1_Click(object sender, EventArgs e) { } } }