public ScpForm() { AppDomain.CurrentDomain.UnhandledException += (sender, args) => { Log.FatalFormat("Unhandled exception: {0}", args.ExceptionObject); }; InitializeComponent(); _settings = new SettingsForm(scpProxy); btnUp_1.Tag = (byte)1; btnUp_2.Tag = (byte)2; btnUp_3.Tag = (byte)3; FormVisible = m_Config.Visible; FormSaved = m_Config.FormSaved; FormX = m_Config.FormX; FormY = m_Config.FormY; ConfSaved = m_Config.ConfSaved; ConfX = m_Config.ConfX; ConfY = m_Config.ConfY; ProfSaved = m_Config.ProfSaved; ProfX = m_Config.ProfX; ProfY = m_Config.ProfY; if (FormSaved) { StartPosition = FormStartPosition.Manual; Location = new Point(FormX, FormY); } if (!FormVisible) { WindowState = FormWindowState.Minimized; Visible = false; } if (ConfSaved) { _settings.StartPosition = FormStartPosition.Manual; _settings.Location = new Point(ConfX, ConfY); } if (ProfSaved) { _profiles.StartPosition = FormStartPosition.Manual; _profiles.Location = new Point(ProfX, ProfY); } lblHost.Text = "Host Address : 00:00:00:00:00:00\r\n\r\n0\r\n\r\n0\r\n\r\n0"; lblPad_1.Text = "Pad 1 : DS3 00:00:00:00:00:00 - USB FFFFFFFF Charging"; var SizeX = 50 + lblHost.Width + lblPad_1.Width; var SizeY = 20 + lblHost.Height; lblPad_1.Location = new Point(new Size(40 + lblHost.Width, 10 + lblHost.Height / 7 * 0)); lblPad_2.Location = new Point(new Size(40 + lblHost.Width, 10 + lblHost.Height / 7 * 2)); lblPad_3.Location = new Point(new Size(40 + lblHost.Width, 10 + lblHost.Height / 7 * 4)); lblPad_4.Location = new Point(new Size(40 + lblHost.Width, 10 + lblHost.Height / 7 * 6)); btnUp_1.Location = new Point(lblPad_2.Location.X - 26, lblPad_2.Location.Y - 6); btnUp_2.Location = new Point(lblPad_3.Location.X - 26, lblPad_3.Location.Y - 6); btnUp_3.Location = new Point(lblPad_4.Location.X - 26, lblPad_4.Location.Y - 6); ClientSize = new Size(SizeX, SizeY); }