Inheritance: System.Windows.Forms.Control
示例#1
0
        /// <summary>
        /// Initialize a new instance of the KryptonDockingFloatingWindow class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="owner">Reference to form that owns the floating windows.</param>
        /// <param name="floatspace">Reference to form that will own all the floating window.</param>
        public KryptonDockingFloatingWindow(string name, Form owner, KryptonDockingFloatspace floatspace)
            : base(name)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }
            if (floatspace == null)
            {
                throw new ArgumentNullException("floatspace");
            }

            _floatspace           = floatspace;
            _floatspace.Disposed += new EventHandler(OnDockingFloatspaceDisposed);

            // Create the actual window control and hook into events
            _window = new KryptonFloatingWindow(owner, floatspace.FloatspaceControl);
            _window.WindowCloseClicked    += new EventHandler <UniqueNamesEventArgs>(OnFloatingWindowCloseClicked);
            _window.WindowCaptionDragging += new EventHandler <ScreenAndOffsetEventArgs>(OnFloatingWindowCaptionDragging);
            _window.Disposed += new EventHandler(OnFloatingWindowDisposed);

            // Create and add a control we use to obscure the floating window client area during multi-part operations
            _obscure         = new ObscureControl();
            _obscure.Anchor  = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
            _obscure.Visible = false;
            _window.Controls.Add(_obscure);

            // Add the floatspace as the only child of this collection
            InternalAdd(floatspace);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonDockingFloatingWindow class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="owner">Reference to form that owns the floating windows.</param>
        /// <param name="floatspace">Reference to form that will own all the floating window.</param>
        /// <param name="useMinimiseBox">Allow window to be minimised.</param>
        public KryptonDockingFloatingWindow(string name, Form owner, KryptonDockingFloatspace floatspace, bool useMinimiseBox)
            : base(name)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }

            FloatspaceElement           = floatspace ?? throw new ArgumentNullException(nameof(floatspace));
            FloatspaceElement.Disposed += OnDockingFloatspaceDisposed;

            // Create the actual window control and hook into events
            FloatingWindow = new KryptonFloatingWindow(owner, floatspace.FloatspaceControl, useMinimiseBox);
            FloatingWindow.WindowCloseClicked    += OnFloatingWindowCloseClicked;
            FloatingWindow.WindowCaptionDragging += OnFloatingWindowCaptionDragging;
            FloatingWindow.Disposed += OnFloatingWindowDisposed;

            // Create and add a control we use to obscure the floating window client area during multi-part operations
            _obscure = new ObscureControl
            {
                Anchor  = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom),
                Visible = false
            };
            FloatingWindow.Controls.Add(_obscure);

            // Add the floatspace as the only child of this collection
            InternalAdd(floatspace);
        }
示例#3
0
        private void Construct(Control control, IDockingElement innerElement)
        {
            _innerElement = innerElement;
            _innerMinimum = INNER_MINIMUM;

            // Hook into events on the target control
            _control              = control;
            _control.SizeChanged += new EventHandler(OnControlSizeChanged);
            _control.Disposed    += new EventHandler(OnControlDisposed);

            // Create and add a control we use to obscure the client area during multi-part operations
            _obscure         = new ObscureControl();
            _obscure.Anchor  = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
            _obscure.Visible = false;
            _control.Controls.Add(_obscure);

            // Create docking elements for managing each of the four control edges
            Add(new KryptonDockingEdge("Top", control, DockingEdge.Top));
            Add(new KryptonDockingEdge("Bottom", control, DockingEdge.Bottom));
            Add(new KryptonDockingEdge("Left", control, DockingEdge.Left));
            Add(new KryptonDockingEdge("Right", control, DockingEdge.Right));
        }
        private void Construct(Control control, IDockingElement innerElement)
        {
            _innerElement = innerElement;
            _innerMinimum = INNER_MINIMUM;

            // Hook into events on the target control
            _control = control;
            _control.SizeChanged += new EventHandler(OnControlSizeChanged);
            _control.Disposed += new EventHandler(OnControlDisposed);

            // Create and add a control we use to obscure the client area during multi-part operations
            _obscure = new ObscureControl();
            _obscure.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
            _obscure.Visible = false;
            _control.Controls.Add(_obscure);

            // Create docking elements for managing each of the four control edges
            Add(new KryptonDockingEdge("Top", control, DockingEdge.Top));
            Add(new KryptonDockingEdge("Bottom", control, DockingEdge.Bottom));
            Add(new KryptonDockingEdge("Left", control, DockingEdge.Left));
            Add(new KryptonDockingEdge("Right", control, DockingEdge.Right));
        }
        /// <summary>
        /// Initialize a new instance of the KryptonDockingFloatingWindow class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="owner">Reference to form that owns the floating windows.</param>
        /// <param name="floatspace">Reference to form that will own all the floating window.</param>
        public KryptonDockingFloatingWindow(string name, Form owner, KryptonDockingFloatspace floatspace)
            : base(name)
        {
            if (owner == null)      throw new ArgumentNullException("owner");
            if (floatspace == null) throw new ArgumentNullException("floatspace");

            _floatspace = floatspace;
            _floatspace.Disposed += new EventHandler(OnDockingFloatspaceDisposed);

            // Create the actual window control and hook into events
            _window = new KryptonFloatingWindow(owner, floatspace.FloatspaceControl);
            _window.WindowCloseClicked += new EventHandler<UniqueNamesEventArgs>(OnFloatingWindowCloseClicked);
            _window.WindowCaptionDragging += new EventHandler<ScreenAndOffsetEventArgs>(OnFloatingWindowCaptionDragging);
            _window.Disposed += new EventHandler(OnFloatingWindowDisposed);

            // Create and add a control we use to obscure the floating window client area during multi-part operations
            _obscure = new ObscureControl();
            _obscure.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
            _obscure.Visible = false;
            _window.Controls.Add(_obscure);

            // Add the floatspace as the only child of this collection
            InternalAdd(floatspace);
        }