コード例 #1
0
ファイル: PinForm.cs プロジェクト: tesys25/pinwin
        /// <summary>
        ///  Calculates absolute location of pin icon based on parent form's handle.
        /// </summary>
        /// <param name="handle">Parent window handle.</param>
        /// <returns>Absolute location of pin icon.</returns>
        private static Point GetRelativeLocation(IntPtr handle)
        {
            int       rightMargin = PinForm.GetControlAreaWidth(handle) + 20;
            Rectangle move        = ApiWindowPos.Get(handle);

            return(new Point(move.Left + move.Width - rightMargin, move.Top + 5));
        }
コード例 #2
0
        /// <summary>
        ///  Calculates absolute location of pin icon based on parent form's handle.
        /// </summary>
        /// <param name="handle">Parent window handle.</param>
        /// <returns>Absolute location of pin icon.</returns>
        private static Point GetRelativeLocation(IntPtr handle)
        {
            var       style       = new WindowStyle(handle);
            int       rightMargin = style.GetControlBoxWidth() + 20;
            Rectangle move        = ApiWindowPos.Get(handle);

            return(new Point(move.Left + move.Width - rightMargin, move.Top + 5));
        }
コード例 #3
0
        /// <summary>
        ///     Override in child form for custom
        /// </summary>
        protected virtual void MoveToParentWindow()
        {
            Rectangle parentRectangle = ApiWindowPos.Get(ParentHandle);

            MoveToParent(parentRectangle);
        }