/// <summary> /// Docks the scanner to another window (the parent parameter) /// </summary> /// <param name="parent">window to dock to</param> /// <param name="position">relative position of docking</param> public void DockScanner(IntPtr parent, Windows.WindowPosition position) { _dock = true; AutoPosition = false; _dockScanner = new DockScanner(parent, _form, position); if (Windows.GetVisible(_form)) { _dockScanner.Dock(); } }
/// <summary> /// Event handler for when the scanner is shown. Dock it if /// necesary otherwise just position it /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _form_Shown(object sender, EventArgs e) { if (_dock && _dockScanner != null) { _dockScanner.Dock(); } else { SetPositionAndNotify(); } }