protected void DetachNotesPane() { if (_formNotes == null) { _formNotes = new FormNotes(_paneAdvNotes); _formNotes.FormClosing += formNotes_FormClosing; _formNotes.Show(_views.MainForm); if (!_initialWindowRect.IsEmpty) { _formNotes.Left = _initialWindowRect.Left; _formNotes.Top = _initialWindowRect.Top; if (_initialWindowState != FormWindowState.Maximized) { _formNotes.Width = _initialWindowRect.Width; _formNotes.Height = _initialWindowRect.Height; } } _formNotes.WindowState = _initialWindowState; /////////////////////////////////////////////////////////////// _splitter2.Panel2Collapsed = true; _isNotesDetached = true; } else { RestoreNotesPane(); _isNotesDetached = false; } }
protected void OnNotesFormClosing(FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { _initialWindowRect = new Rectangle(_formNotes.Left, _formNotes.Top, _formNotes.Width, _formNotes.Height); _initialWindowState = _formNotes.WindowState; _formNotes = null; _splitter.Panel2Collapsed = false; } }