New to Telerik UI for WinForms? Download free 30-day trial

Popup

The RadNotifyIcon allows for displaying a popup upon interacting with the icon or by manually calling the exposed methods.

PopupContent

The PopupContent property allow for setting the popup's content and changing its default look. The PopupContent property is of type Control. This way you can design your Form, UserControl, etc. and set it as a content of the popup.


void ShowNotifyIconPopup()
{
    RadNotifyIcon radNotifyIcon = new RadNotifyIcon();
    radNotifyIcon.TrayIcon = new System.Drawing.Icon("../../WinForms128x28.ico");
    radNotifyIcon.PopupContent = new UserControl1();
    radNotifyIcon.ShowTrayIcon = true;
}


Private Sub ShowNotifyIconPopup()
    Dim radNotifyIcon As RadNotifyIcon = New RadNotifyIcon()
    radNotifyIcon.TrayIcon = New System.Drawing.Icon("../../WinForms128x28.ico")
    radNotifyIcon.PopupContent = New UserControl1()
    radNotifyIcon.ShowTrayIcon = True
End Sub


Figure 1: RadNotifyIcon with Popup (Windows 11 OS)

RadNotifyIcon with activated popup

PopupActivationMouseEvent

The PopupActivationMouseEvent property determines when the popup will be shown. The default value is LeftClick. This property is enumeration and it expose the following values:

  • LeftClick: Triggered on left mouse click.
  • RightClick: Triggered on right mouse click.
  • MiddleClick: Triggered on middle mouse click.
  • LeftDoubleClick: Triggered on left mouse double click.
  • RightDoubleClick: Triggered on right mouse double click.
  • MiddleDoubleClick: Triggered on middle mouse double click.
  • All: Triggered on any mouse click action.

radNotifyIcon.PopupActivationMouseEvent = MouseActivationEvent.All;



radNotifyIcon.PopupActivationMouseEvent = MouseActivationEvent.All


PopupShowDuration

The PopupShowDuration specifies the amount of time in milliseconds after which the popup will begin to close automatically. The default value is 5000 milliseconds (5s).


radNotifyIcon.PopupShowDuration = 3000;



radNotifyIcon.PopupShowDuration = 3000


PopupCloseMode

The PopupCloseMode is a bitwise enumeration, which controls the actions that will close the popup. The possible values are:

  • None: The popup can only be closed in code (with the HidePopup method) or by clicking on the notify icon.
  • Deactivate: The popup can be closed by clicking outside of it or by deactivating it with a windows keyboard shortcut.
  • Timeout: The popup will be closed after the time specified by the PopupShowDuration runs out. This is the default value.

Programmatically Showing the Popup

The RadNotifyIcon allows for programmatically showing a popup through the ShowPopup method. It exposes one overload, which provides the option of specifying a screen location.

  • void ShowPopup(): Shows the popup on top of the notify icon.
  • void ShowPopup(Point location): Shows the popup at the provided location.
radNotifyIcon.ShowPopup();

radNotifyIcon.ShowPopup()

Programmatically Hiding the Popup

You can manually hide the popup with the HidePopup method as shown in Example 6.


radNotifyIcon.HidePopup();


radNotifyIcon.HidePopup()

You can control the opening and closing animation with the PopupShowAnimation and PopupHideAnimation properties respectively. These properties are enumeration (NotifyIconAnimationType) and it expose the following values:

  • None: No animation.
  • Fade: A Fade animation is applied.
  • Timeout: A 'Slide' animation is applied.

radNotifyIcon.PopupShowAnimation = NotifyIconAnimationType.Slide;
radNotifyIcon.PopupHideAnimation = NotifyIconAnimationType.Fade;


radNotifyIcon.PopupShowAnimation = NotifyIconAnimationType.Slide
radNotifyIcon.PopupHideAnimation = NotifyIconAnimationType.Fade

Figure 2: Show/Hide Animation (Windows 10 OS)

RadNotifyIcon show/hide animation

IsPopupOpen

The IsPopupOpen property allows you to check whether a popup is currently open.

See Also

In this article