public void Initialize() { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(true); Application.Init(); Application.Invoke(delegate { this.optionsForm = new OptionsForm(); }); }
private void CreateOptionsForm() { this.optionsForm = new OptionsForm(); this.optionsForm.CreateControl(); this.optionsForm.StartPosition = FormStartPosition.Manual; this.optionsForm.Location = new Point(-5000, -5000); // Must be shown first just to get a window handle used by BeginInvoke (see notifications). this.optionsForm.Show(); this.optionsForm.Hide(); var screen = Screen.FromControl(this.optionsForm); this.optionsForm.Location = new Point((screen.Bounds.Width-this.optionsForm.Width)/2,(screen.Bounds.Height-this.optionsForm.Height)/2); }