ComponentFactory.Krypton.Toolkit.VisualPopupShadow.Show C# (CSharp) Method

Show() public method

Show the popup using the provided rectangle as the screen rect.
public Show ( Rectangle screenRect ) : void
screenRect System.Drawing.Rectangle Screen rectangle for showing the popup.
return void
        public virtual void Show(Rectangle screenRect)
        {
            // Offset by the width/height of the shadow
            screenRect.X += SHADOW_SIZE;
            screenRect.Y += SHADOW_SIZE;

            // Update the screen position
            Location = screenRect.Location;
            ClientSize = screenRect.Size;

            // Show the window without activating it (i.e. do not take focus)
            PI.ShowWindow(this.Handle, (short)PI.SW_SHOWNOACTIVATE);
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Show the popup using the provided rectangle as the screen rect.
        /// </summary>
        /// <param name="screenRect">Screen rectangle for showing the popup.</param>
        public virtual void Show(Rectangle screenRect)
        {
            // Update the screen position
            SetBounds(screenRect.X, screenRect.Y,
                      screenRect.Width, screenRect.Height);

            // If we have a shadow then update it now
            _shadow?.Show(screenRect);

            // Show the window without activating it (i.e. do not take focus)
            PI.ShowWindow(Handle, PI.ShowWindowCommands.SW_SHOWNOACTIVATE);

            // Use manager to track mouse/keyboard input and to dismiss the window
            VisualPopupManager.Singleton.StartTracking(this);
        }