ClassRadPopupControlBase
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
RadPopupControlBase(RadElement)
Creates an instance of the RadPopupFormBase class.
Declaration
public RadPopupControlBase(RadElement owner)
Parameters
owner
Fields
AnimationProperties
Declaration
public RadPopupControlBase.PopupAnimationProperties AnimationProperties
Field Value
Properties
AlignmentRectangleOverlapMode
Gets or sets a value from the AlignmentRectangleOverlapMode 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.
Declaration
public AlternativeCorrectionMode AlignmentRectangleOverlapMode { get; set; }
Property Value
AnimationEnabled
Gets or sets a bool value determining whether popup animation is enabled.
AnimationFrames
Gets or sets the count of the frames of the drop down animation.
AnimationType
Gets or sets a value determining what animation type to use when showing the popup.
Declaration
public PopupAnimationTypes AnimationType { get; set; }
Property Value
Children
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.
Declaration
public List<IPopupControl> Children { get; }
Property Value
List<IPopupControl>
Implements
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Overrides
DropDownAnimationDirection
Gets or sets the direction of the drop-down animation.
Declaration
public RadDirection DropDownAnimationDirection { get; set; }
Property Value
DropShadow
Gets or sets a boolean value which determines whether the popup drops a shadow.
EasingType
Gets or sets the easing type for the drop down animations.
Declaration
public RadEasingType EasingType { get; set; }
Property Value
EnableAeroEffects
Enables the support for Windows Vista DWM effects.
FadeAnimationFrames
Gets or sets the frame count for the fade animation.
FadeAnimationSpeed
Gets or sets the time interval for each fade animation frame.
FadeAnimationType
Gets or sets a value indicating the type of the fade animation.
Declaration
public FadeAnimationType FadeAnimationType { get; set; }
Property Value
FitToScreenMode
Gets or sets a value from the FitToScreenModes enum which defines how the size of the popup is fit to the currently active screen.
Declaration
public FitToScreenModes FitToScreenMode { get; set; }
Property Value
HorizontalAlignmentCorrectionMode
Defines how the popup will be horizontally aligned in case of lack of screen space.
Declaration
public AlignmentCorrectionMode HorizontalAlignmentCorrectionMode { get; set; }
Property Value
HorizontalPopupAlignment
Gets or sets a value that defines the horizontal alignment of the popup based on the alignment rectangle passed in the ShowPopup method.
Declaration
public HorizontalPopupAlignment HorizontalPopupAlignment { get; set; }
Property Value
LastShowDpiScaleFactor
Declaration
public SizeF LastShowDpiScaleFactor { get; set; }
Property Value
Opacity
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.
OwnerElement
Gets the RadElement that owns this popup.
Declaration
[Browsable(false)]
public RadElement OwnerElement { get; }
Property Value
Implements
OwnerPopup
Declaration
[Browsable(false)]
public IPopupControl OwnerPopup { get; }
Property Value
Implements
ScreenSpaceMode
Gets or sets a value from the ScreenSpaceMode enum which determines what part of the screen is considered when positioning the popup.
Declaration
public ScreenSpaceMode ScreenSpaceMode { get; set; }
Property Value
ShouldRestoreAutoSize
Declaration
protected virtual bool ShouldRestoreAutoSize { get; }
Property Value
VerticalAlignmentCorrectionMode
Defines how the popup will be vertically aligned in case of lack of screen space.
Declaration
public AlignmentCorrectionMode VerticalAlignmentCorrectionMode { get; set; }
Property Value
VerticalPopupAlignment
Gets or sets a value that defines the vertical alignment of the popup based on the alignment rectangle passed in the ShowPopup method.
Declaration
public VerticalPopupAlignment VerticalPopupAlignment { get; set; }
Property Value
WindowsSettings
Gets or sets the windows related setting.
Declaration
public WindowsSettings WindowsSettings { get; set; }
Property Value
Methods
AnimationStarting()
Fires when a drop-down animation is about to begin.
Declaration
protected virtual void AnimationStarting()
CallMouseWheel(MouseEventArgs)
Raises the MouseWheel event.
Declaration
protected virtual void CallMouseWheel(MouseEventArgs e)
Parameters
e
CanClosePopup(RadPopupCloseReason)
This method determines whether the IPopupControl can be closed. Used in the PopupManager class to prevent the IPopupControl from closing in specific occasions.
Declaration
public virtual bool CanClosePopup(RadPopupCloseReason reason)
Parameters
reason
The reason why the IPopupControl is closed.
Returns
True if the IPopupControl can be closed, otherwise false.
Implements
CheckMakeLastLocationCorrection(Rectangle, Point, Rectangle)
Checks whether the current alignment rectangle intersects with the popup's bounds according to a given popup location.
Declaration
protected virtual Point CheckMakeLastLocationCorrection(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds)
Parameters
alignmentRectangle
An instance of the Rectangle struct that represents the current alignment rectangle.
proposedLocation
An instance of the Point struct that represents the proposed popup location.
availableBounds
An 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.
CheckMakeLastLocationCorrection(Rectangle, Point, Rectangle, Size)
Checks whether the current alignment rectangle intersects with the popup's bounds according to a given popup location.
Declaration
protected virtual Point CheckMakeLastLocationCorrection(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds, Size popupSize)
Parameters
alignmentRectangle
An instance of the Rectangle struct that represents the current alignment rectangle.
proposedLocation
An instance of the Point struct that represents the proposed popup location.
availableBounds
An instance of the Rectangle struct that represents the available bounds on the screen.
popupSize
The size of the popup.
Returns
An instance of the Point struct that represents the result of the operation.
ClosePopup(PopupCloseInfo)
Closes the popup.
Declaration
public virtual void ClosePopup(PopupCloseInfo info)
Parameters
info
The info.
Implements
ClosePopup(RadPopupCloseReason)
Closes the IPopupControl.
Declaration
public virtual void ClosePopup(RadPopupCloseReason reason)
Parameters
reason
Implements
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
Overrides
GetAvailableBoundsFromScreen(Screen)
Gets a Rectangle which represents the available bounds for the popup to show. By default this method returns the bounds of the screen.
Declaration
protected virtual Rectangle GetAvailableBoundsFromScreen(Screen screen)
Parameters
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.
GetCorrectedHorizontalLocation(Screen, Rectangle, Point)
Calculates the horizontal position of the popup according to the current HorizontalPopupAlignment and AlignmentCorrectionMode.
Declaration
protected virtual Point GetCorrectedHorizontalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation)
Parameters
currentScreen
The screen in which the popup will be aligned.
alignmentRectangle
The alignment rectangle of the popup.
calculatedLocation
The calculated location that will be corrected if needed.
Returns
An instance of the Point struct that represents the corrected location of the popup
GetCorrectedHorizontalLocation(Screen, Rectangle, Point, Size)
Calculates the horizontal position of the popup according to the current HorizontalPopupAlignment and AlignmentCorrectionMode.
Declaration
protected virtual Point GetCorrectedHorizontalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation, Size popupSize)
Parameters
currentScreen
The screen in which the popup will be aligned.
alignmentRectangle
The alignment rectangle of the popup.
calculatedLocation
The calculated location that will be corrected if needed.
popupSize
The size of the popup.
Returns
An instance of the Point struct that represents the corrected location of the popup
GetCorrectedLocation(Rectangle)
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 settin the HorizontalPopupAlignment and VerticalPopupAlignment properties.
Declaration
protected virtual Point GetCorrectedLocation(Rectangle alignmentRectangle)
Parameters
alignmentRectangle
The alignment rectangle based on which the popup is aligned.
Returns
An instance of the Point struct that represents the calculated position of the popup.
GetCorrectedLocation(Screen, Rectangle)
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 settin the HorizontalPopupAlignment and VerticalPopupAlignment properties.
Declaration
protected virtual Point GetCorrectedLocation(Screen currentScreen, Rectangle alignmentRectangle)
Parameters
currentScreen
An instance of the Screen class that represents the screen where the popup is about to be positioned.
alignmentRectangle
The alignment rectangle based on which the popup is aligned.
Returns
An instance of the Point struct that represents the calculated position of the popup.
GetCorrectedLocation(Screen, Rectangle, Size)
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 settin the HorizontalPopupAlignment and VerticalPopupAlignment properties.
Declaration
protected virtual Point GetCorrectedLocation(Screen currentScreen, Rectangle alignmentRectangle, Size popupSize)
Parameters
currentScreen
An instance of the Screen class that represents the screen where the popup is about to be positioned.
alignmentRectangle
The alignment rectangle based on which the popup is aligned.
popupSize
The size of the popup.
Returns
An instance of the Point struct that represents the calculated position of the popup.
GetCorrectedVerticalLocation(Screen, Rectangle, Point)
Calculates the vertical position of the popup according to the current VerticalPopupAlignment and AlignmentCorrectionMode.
Declaration
protected virtual Point GetCorrectedVerticalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation)
Parameters
currentScreen
The screen in which the popup will be aligned.
alignmentRectangle
The alignment rectangle of the popup.
calculatedLocation
The calculated location that will be corrected if needed.
Returns
An integer that represents the corrected vertical location of the popup
GetCorrectedVerticalLocation(Screen, Rectangle, Point, Size)
Calculates the vertical position of the popup according to the current VerticalPopupAlignment and AlignmentCorrectionMode.
Declaration
protected virtual Point GetCorrectedVerticalLocation(Screen currentScreen, Rectangle alignmentRectangle, Point calculatedLocation, Size popupSize)
Parameters
currentScreen
The screen in which the popup will be aligned.
alignmentRectangle
The alignment rectangle of the popup.
calculatedLocation
The calculated location that will be corrected if needed.
popupSize
The size of the popup.
Returns
An integer that represents the corrected vertical location of the popup
GetCurrentScreen()
Gets an instance of the Screen class that represents the screen where the popup is displayed.
GetCurrentScreen(Rectangle)
Gets the screen on which the popup will be displayed.
GetHorizontalPopupLocation(Rectangle)
Calculates the horizontal popup location based on the alignmentRectangle.
This method uses the HorizontalPopupAlignment property setting.
Declaration
protected virtual int GetHorizontalPopupLocation(Rectangle alignmentRectangle)
Parameters
alignmentRectangle
An instance of the Rectangle struct that represents the alignment rectangle.
Returns
Returns an integer that represents the X coordinate of the popup.
GetMonitorDpiScaleFactor(Control)
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.
GetVerticalPopupLocation(Rectangle)
Calculates the vertical popup location based on the alignmentRectangle.
This method uses the VerticalPopupAlignment property setting.
Declaration
protected virtual int GetVerticalPopupLocation(Rectangle alignmentRectangle)
Parameters
alignmentRectangle
An instance of the Rectangle struct that represents the alignment rectangle.
Returns
Returns an integer that represents the Y coordinate of the popup.
InitializeDropDownAnimation(Point)
Declaration
protected virtual void InitializeDropDownAnimation(Point location)
Parameters
location
OnAlternativeXLocationNeeded(Rectangle, Point, Rectangle)
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.
Declaration
protected virtual Point OnAlternativeXLocationNeeded(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds)
Parameters
alignmentRectangle
The proposed alignment rectangle with screen coordinates.
proposedLocation
The proposed coordinates
availableBounds
The proposed available space for the popup.
Returns
An instance of the Point struct that represents the location of the popup.
OnAlternativeYLocationNeeded(Rectangle, Point, Rectangle)
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.
Declaration
protected virtual Point OnAlternativeYLocationNeeded(Rectangle alignmentRectangle, Point proposedLocation, Rectangle availableBounds)
Parameters
alignmentRectangle
The proposed alignment rectangle with screen coordinates.
proposedLocation
The proposed coordinates
availableBounds
The proposed available space for the popup.
Returns
An instance of the Point struct that represents the location of the popup.
OnAnimating(AnimationEventArgs)
Declaration
protected virtual void OnAnimating(AnimationEventArgs e)
Parameters
e
OnAnimationFinished(AnimationEventArgs)
Declaration
protected virtual void OnAnimationFinished(AnimationEventArgs args)
Parameters
args
OnKeyDown(Keys)
Executes when a key is pressed.
OnMouseWheel(Control, int)
Determines whether the MouseWheel event is handled by the popup.
OnPopupClosed(PopupCloseInfo)
Called when popup is closed.
Declaration
protected virtual void OnPopupClosed(PopupCloseInfo info)
Parameters
info
The info.
OnPopupClosed(RadPopupClosedEventArgs)
Fires when the popup is closed.
Declaration
protected virtual void OnPopupClosed(RadPopupClosedEventArgs args)
Parameters
args
A RadPopupClosedEventArgs instance that contains information about what caused the popup to close.
OnPopupClosing(PopupCloseInfo)
Called when the popup is closing.
Declaration
protected virtual bool OnPopupClosing(PopupCloseInfo info)
Parameters
info
The info.
Returns
OnPopupClosing(RadPopupClosingEventArgs)
Fires when the popup is about to close.
Declaration
protected virtual void OnPopupClosing(RadPopupClosingEventArgs args)
Parameters
args
A RadPopupClosingEventArgs instance that contains information about the event
OnPopupOpened()
Fires when the popup is opened.
Declaration
protected virtual void OnPopupOpened()
OnPopupOpening(CancelEventArgs)
Fires when the popup is about to open.
Declaration
protected virtual void OnPopupOpening(CancelEventArgs args)
Parameters
args
A CancelEventArgs object that contains information about the event
ProcessFocusRequested(RadElement)
Processes a focus request from the specified element.
Declaration
protected override bool ProcessFocusRequested(RadElement element)
Parameters
element
The element that requested the focus.
Returns
True if focus is approved, false otherwise.
Overrides
Show()
Shows the popup based on the value set to its Location property.
Declaration
public void Show()
Show(Control)
Shows the control based on the screen rectangle of a given control.
Declaration
public void Show(Control control)
Parameters
control
The control which defines the location of the popup.
Show(Point)
Shows the popup at the location passed as a parameter. The location is in screen coordinates
ShowPopup(Rectangle)
Shows the popup.
Declaration
public virtual void ShowPopup(Rectangle alignmentRectangle)
Parameters
alignmentRectangle
The alignment rectangle.
Implements
UpdateAeroEffectState()
Updates the Aero effects support upon property change.
Declaration
protected void UpdateAeroEffectState()
UpdateLocation()
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.
Declaration
public void UpdateLocation()
UpdateLocation(Rectangle)
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.
Declaration
public void UpdateLocation(Rectangle alignmentRectangle)
Parameters
alignmentRectangle
The alignment rectangle based on which the popup is positioned.
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
Parameters
m
Overrides
Events
FadeAnimationFinished
Fires when a fade animation has finished. The event args contain information about the type of the animation.
Declaration
public event RadPopupFadeAnimationFinishedEventHandler FadeAnimationFinished
Event Value
MouseWheel
Occurs when the mouse pointer is moved over the element.
Declaration
[Browsable(false)]
public event MouseEventHandler MouseWheel
Event Value
PopupClosed
Fires when the popup is closed.
Declaration
public event RadPopupClosedEventHandler PopupClosed
Event Value
PopupClosing
Fires when the popup is about to be closed.
Declaration
public event RadPopupClosingEventHandler PopupClosing
Event Value
PopupOpened
Fires when the popup-form is opened.
Declaration
public event RadPopupOpenedEventHandler PopupOpened
Event Value
PopupOpening
Fires when the popup-form is about to be opened.
Declaration
public event RadPopupOpeningEventHandler PopupOpening
Event Value