RadPopupControlBase
Represents a base class for all popup-forms used throughout the suite.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadPopupControlBase : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IPopupControl
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadPopupControlBase...
Derived Classes:
Implements:
Inherited Members
Constructors
Creates an instance of the RadPopupFormBase class.
Fields
public RadPopupControlBase.PopupAnimationProperties AnimationProperties
protected SizeF dpiScaleFactor
protected Rectangle lastAlignmentRectangle
Properties
Gets or sets a value from the AlternativeCorrectionMode which defines how the popup will be positioned according to the alignment rectangle when its location cannot be adjusted so that it meets all popup alignment and alignment correction mode requirements.
public AlternativeCorrectionMode AlignmentRectangleOverlapMode { get; set; }
Gets or sets a bool value determining whether popup animation is enabled.
public bool AnimationEnabled { get; set; }
Gets or sets the count of the frames of the drop down animation.
public int AnimationFrames { get; set; }
Gets or sets a value determining what animation type to use when showing the popup.
public PopupAnimationTypes AnimationType { get; set; }
Children
List<IPopupControl>
Gets a List<T> instance that represents a collection of logical children of this IPopupControl. The OwnerPopup property of these children would point to this IPopupControl instance.
public List<IPopupControl> Children { get; }
Implements:
protected override CreateParams CreateParams { get; }
Overrides:
Gets or sets the direction of the drop-down animation.
public RadDirection DropDownAnimationDirection { get; set; }
Gets or sets a boolean value which determines whether the popup drops a shadow.
public bool DropShadow { get; set; }
Gets or sets the easing type for the drop down animations.
public RadEasingType EasingType { get; set; }
Enables the support for Windows Vista DWM effects.
public bool EnableAeroEffects { get; set; }
Gets or sets the frame count for the fade animation.
public int FadeAnimationFrames { get; set; }
Gets or sets the time interval for each fade animation frame.
public int FadeAnimationSpeed { get; set; }
Gets or sets a value indicating the type of the fade animation.
public FadeAnimationType FadeAnimationType { get; set; }
Gets or sets a value from the FitToScreenModes enum which defines how the size of the popup is fit to the currently active screen.
public FitToScreenModes FitToScreenMode { get; set; }
Defines how the popup will be horizontally aligned in case of lack of screen space.
public AlignmentCorrectionMode HorizontalAlignmentCorrectionMode { get; set; }
Gets or sets a value that defines the horizontal alignment of the popup based on the alignment rectangle passed in the ShowPopup method.
public HorizontalPopupAlignment HorizontalPopupAlignment { get; set; }
public SizeF LastShowDpiScaleFactor { get; set; }
protected Size NonAnimatedSize { get; }
Gets or sets a float value that determines the opacity of the popup. This property accepts values from 0.0 to 1.0. For example, to make the popup semi-transparent, set the property to 0.5.
public float Opacity { get; set; }
Gets the RadElement that owns this popup.
[Browsable(false)]
public RadElement OwnerElement { get; }
Implements:
[Browsable(false)]
public IPopupControl OwnerPopup { get; }
Implements:
Gets or sets a value from the ScreenSpaceMode enum which determines what part of the screen is considered when positioning the popup.
public ScreenSpaceMode ScreenSpaceMode { get; set; }
protected virtual bool ShouldRestoreAutoSize { get; }
Defines how the popup will be vertically aligned in case of lack of screen space.
public AlignmentCorrectionMode VerticalAlignmentCorrectionMode { get; set; }
Gets or sets a value that defines the vertical alignment of the popup based on the alignment rectangle passed in the ShowPopup method.
public VerticalPopupAlignment VerticalPopupAlignment { get; set; }
Gets or sets the windows related setting.
public WindowsSettings WindowsSettings { get; set; }
Methods
Fires when a drop-down animation is about to begin.
protected virtual void AnimationStarting()
Raises the MouseWheel event.
protected virtual void CallMouseWheel(MouseEventArgs e)
An instance of the MouseEventArgs class containing the event data.
This method determines whether the IPopupControl can be closed. Used in the PopupManager class to prevent the IPopupControl from closing in specific occasions.
public virtual bool CanClosePopup(RadPopupCloseReason reason)
The reason why the IPopupControl is closed.
Returns:True if the IPopupControl can be closed, otherwise false.
Implements:
Checks whether the current alignment rectangle intersects with the popup's bounds according to a given popup location.
protected virtual Point CheckMakeLastLocationCorrection(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds, Size popupSize)
An instance of the Rectangle struct that represents the current alignment rectangle.
proposedLocationPointAn instance of the Point struct that represents the proposed popup location.
availableBoundsRectangleAn instance of the Rectangle struct that represents the available bounds on the screen.
popupSizeSizeThe size of the popup.
Returns:An instance of the Point struct that represents the result of the operation.
Checks whether the current alignment rectangle intersects with the popup's bounds according to a given popup location.
protected virtual Point CheckMakeLastLocationCorrection(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds)
An instance of the Rectangle struct that represents the current alignment rectangle.
proposedLocationPointAn instance of the Point struct that represents the proposed popup location.
availableBoundsRectangleAn instance of the Rectangle struct that represents the available bounds on the screen.
Returns:An instance of the Point struct that represents the result of the operation.
Closes the popup.
public virtual void ClosePopup(PopupCloseInfo info)
The info.
Implements:
Closes the IPopupControl.
public virtual void ClosePopup(RadPopupCloseReason reason)
The reason why the IPopupControl is closed.
Implements:
Gets a Rectangle which represents the available bounds for the popup to show. By default this method returns the bounds of the screen.
protected virtual Rectangle GetAvailableBoundsFromScreen(Screen screen)
An instance of the Screen class that represents the active screen where the popup is about to be shown.
Returns:An instance of the Rectangle struct that represents the available bounds for the popup based on the active screen.
Calculates the horizontal position of the popup according to the current HorizontalPopupAlignment and AlignmentCorrectionMode.
protected virtual Point GetCorrectedHorizontalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation, Size popupSize)
The screen in which the popup will be aligned.
alignmentRectangleRectangleThe alignment rectangle of the popup.
calculatedLocationPointThe calculated location that will be corrected if needed.
popupSizeSizeThe size of the popup.
Returns:An instance of the Point struct that represents the corrected location of the popup
Calculates the horizontal position of the popup according to the current HorizontalPopupAlignment and AlignmentCorrectionMode.
protected virtual Point GetCorrectedHorizontalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation)
The screen in which the popup will be aligned.
alignmentRectangleRectangleThe alignment rectangle of the popup.
calculatedLocationPointThe calculated location that will be corrected if needed.
Returns:An instance of the Point struct that represents the corrected location of the popup
This method returns a point which defines the position of the popup.
By default, aligns the popup based on the alignmentRectangle
and the current alignment settings. You can adjust the alignment settings
by setting the HorizontalPopupAlignment and VerticalPopupAlignment properties.
This method returns a point which defines the position of the popup.
By default, aligns the popup based on the alignmentRectangle
and the current alignment settings. You can adjust the alignment settings
by setting the HorizontalPopupAlignment and VerticalPopupAlignment properties.
protected virtual Point GetCorrectedLocation(Screen currentScreen, Rectangle alignmentRectangle, Size popupSize)
An instance of the Screen class that represents the screen where the popup is about to be positioned.
alignmentRectangleRectangleThe alignment rectangle based on which the popup is aligned.
popupSizeSizeThe size of the popup.
Returns:An instance of the Point struct that represents the calculated position of the popup.
This method returns a point which defines the position of the popup.
By default, aligns the popup based on the alignmentRectangle
and the current alignment settings. You can adjust the alignment settings
by setting the HorizontalPopupAlignment and VerticalPopupAlignment properties.
protected virtual Point GetCorrectedLocation(Screen currentScreen, Rectangle alignmentRectangle)
An instance of the Screen class that represents the screen where the popup is about to be positioned.
alignmentRectangleRectangleThe alignment rectangle based on which the popup is aligned.
Returns:An instance of the Point struct that represents the calculated position of the popup.
Calculates the vertical position of the popup according to the current VerticalPopupAlignment and AlignmentCorrectionMode.
protected virtual Point GetCorrectedVerticalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation, Size popupSize)
The screen in which the popup will be aligned.
alignmentRectangleRectangleThe alignment rectangle of the popup.
calculatedLocationPointThe calculated location that will be corrected if needed.
popupSizeSizeThe size of the popup.
Returns:An integer that represents the corrected vertical location of the popup
Calculates the vertical position of the popup according to the current VerticalPopupAlignment and AlignmentCorrectionMode.
protected virtual Point GetCorrectedVerticalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation)
The screen in which the popup will be aligned.
alignmentRectangleRectangleThe alignment rectangle of the popup.
calculatedLocationPointThe calculated location that will be corrected if needed.
Returns:An integer that represents the corrected vertical location of the popup
Gets the screen on which the popup will be displayed.
Calculates the horizontal popup location based on the alignmentRectangle.
This method uses the HorizontalPopupAlignment property setting.
Override the base DPI scaling behavior to prevent location calculation bugs in multi-monitor setups.
Problem: When displaying a popup on a secondary monitor with different DPI scaling than the primary monitor (e.g., Primary: 125%, Secondary: 100%), the popup's location is calculated incorrectly on first show.
Root Cause: The popup content is measured and arranged before being shown to determine the correct location. However, if the popup has never been displayed, it uses the primary monitor's DPI settings for measurement. After the first show, the DPI is correctly adjusted, but the initial measurements were wrong, causing incorrect popup positioning.
Solution: Use the owner element's DPI scale factor instead of the base implementation to ensure consistent DPI scaling from the start.
Calculates the vertical popup location based on the alignmentRectangle.
This method uses the VerticalPopupAlignment property setting.
Closes the popup.
public void Hide()
This method is executed when the popup needs to receive manual horizontal alignment. This can happen when there is no reasonable possibility for the alignment routines to define a proper horizontal position for the popup. In this way the developer is enabled to define a horizontal position according to their preferences.
protected virtual Point OnAlternativeXLocationNeeded(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds)
The proposed alignment rectangle with screen coordinates.
proposedLocationPointThe proposed coordinates
availableBoundsRectangleThe proposed available space for the popup.
Returns:An instance of the Point struct that represents the location of the popup.
This method is executed when the popup needs to receive manual vertical alignment. This can happen when there is no reasonable possibility for the alignment routines to define a proper vertical position for the popup. In this way the developer is enabled to define a vertical position according to their preferences.
protected virtual Point OnAlternativeYLocationNeeded(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds)
The proposed alignment rectangle with screen coordinates.
proposedLocationPointThe proposed coordinates
availableBoundsRectangleThe proposed available space for the popup.
Returns:An instance of the Point struct that represents the location of the popup.
protected virtual void OnAnimationFinished(AnimationEventArgs args)
Executes when a key is pressed.
public virtual bool OnKeyDown(Keys keyData)
An instance of the Keys struct which contains the key information.
Returns:A boolean value that determines whether the IPopupControl processes the message.
Implements:
Determines whether the MouseWheel event is handled by the popup.
Called when popup is closed.
Fires when the popup is closed.
protected virtual void OnPopupClosed(RadPopupClosedEventArgs args)
A RadPopupClosedEventArgs instance that contains information about what caused the popup to close.
Called when the popup is closing.
protected virtual bool OnPopupClosing(PopupCloseInfo info)
The info.
Returns:Fires when the popup is about to close.
protected virtual void OnPopupClosing(RadPopupClosingEventArgs args)
A RadPopupClosingEventArgs instance that contains information about the event
Fires when the popup is opened.
protected virtual void OnPopupOpened()
Fires when the popup is about to open.
protected virtual void OnPopupOpening(CancelEventArgs args)
A CancelEventArgs object that contains information about the event
Processes a focus request from the specified element.
protected override bool ProcessFocusRequested(RadElement element)
The element that requested the focus.
Returns:True if focus is approved, false otherwise.
Overrides:
Shows the popup based on the value set to its Location property.
public void Show()
Shows the control based on the screen rectangle of a given control.
public void Show(Control control)
The control which defines the location of the popup.
Shows the popup.
public virtual void ShowPopup(Rectangle alignmentRectangle)
The alignment rectangle.
Implements:
Updates the Aero effects support upon property change.
protected void UpdateAeroEffectState()
Updates the location of the popup based on the last used alignment rectangle and the current alignment settings. You can adjust the alignment settings by using the VerticalPopupAlignment and HorizontalPopupAlignment properties.
public void UpdateLocation()
Updates the location of the popup based on the alignment rectangle and the current alignment settings. You can adjust the alignment settings by using the VerticalPopupAlignment and HorizontalPopupAlignment properties.
public void UpdateLocation(Rectangle alignmentRectangle)
The alignment rectangle based on which the popup is positioned.
Events
Fires when a fade animation has finished. The event args contain information about the type of the animation.
public event RadPopupFadeAnimationFinishedEventHandler FadeAnimationFinished
Occurs when the mouse pointer is moved over the element.
[Browsable(false)]
public event MouseEventHandler MouseWheel
Fires when the popup is closed.
public event RadPopupClosedEventHandler PopupClosed
Fires when the popup is about to be closed.
public event RadPopupClosingEventHandler PopupClosing
Fires when the popup-form is opened.
public event RadPopupOpenedEventHandler PopupOpened
Fires when the popup-form is about to be opened.
public event RadPopupOpeningEventHandler PopupOpening