New to Telerik UI for WPFStart a free 30-day trial

Provides a WPF control that represents a system tray icon with customizable features such as balloon tips, popups, and context menus. The RadNotifyIcon can be used to display an icon in the Windows notification area (system tray), allowing for user interaction with mouse events like clicks and movements. It offers various properties to customize its appearance and behavior such as TrayIcon, BalloonTitle, PopupContent, and more. Additionally, events are raised for user interactions, allowing developers to respond to user's actions, such as opening popups or displaying context menus.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Navigation.dll

Syntax:

C#
[TelerikToolboxCategory("Containers")]
public class RadNotifyIcon : FrameworkElement, IDisposable

Inheritance: objectRadNotifyIcon

Implements: IDisposable

Constructors

Initializes a new instance of the RadNotifyIcon class.

C#
public RadNotifyIcon()

Fields

BalloonIconProperty

DependencyProperty

Identifies the BalloonIcon dependency property.

C#
public static readonly DependencyProperty BalloonIconProperty

BalloonIconSourceProperty

DependencyProperty

Identifies the BalloonIconSource dependency property.

C#
public static readonly DependencyProperty BalloonIconSourceProperty

BalloonTextProperty

DependencyProperty

Identifies the BalloonText dependency property.

C#
public static readonly DependencyProperty BalloonTextProperty

BalloonTitleProperty

DependencyProperty

Identifies the BalloonTitle dependency property.

C#
public static readonly DependencyProperty BalloonTitleProperty

Identifies the ContextMenuActivationMouseEvent dependency property.

C#
public static readonly DependencyProperty ContextMenuActivationMouseEventProperty

GuidItemProperty

DependencyProperty

Identifies the GuidItem dependency property.

C#
public static readonly DependencyProperty GuidItemProperty

Identifies the PopupActivationMouseEvent dependency property.

C#
public static readonly DependencyProperty PopupActivationMouseEventProperty

PopupCloseModeProperty

DependencyProperty

Identifies the PopupCloseMode dependency property.

C#
public static readonly DependencyProperty PopupCloseModeProperty

PopupContentProperty

DependencyProperty

Identifies the PopupContent dependency property.

C#
public static readonly DependencyProperty PopupContentProperty

Identifies the PopupContentTemplate dependency property.

C#
public static readonly DependencyProperty PopupContentTemplateProperty

PopupShowDurationProperty

DependencyProperty

Identifies the PopupShowDuration dependency property.

C#
public static readonly DependencyProperty PopupShowDurationProperty

ShowTrayIconProperty

DependencyProperty

Identifies the ShowTrayIcon dependency property.

C#
public static readonly DependencyProperty ShowTrayIconProperty

TooltipContentProperty

DependencyProperty

Identifies the TooltipContent dependency property.

C#
public static readonly DependencyProperty TooltipContentProperty

Identifies the TooltipContentTemplate dependency property.

C#
public static readonly DependencyProperty TooltipContentTemplateProperty

TrayContextMenuProperty

DependencyProperty

Identifies the TrayContextMenu dependency property.

C#
public static readonly DependencyProperty TrayContextMenuProperty

TrayIconProperty

DependencyProperty

Identifies the TrayIcon dependency property.

C#
public static readonly DependencyProperty TrayIconProperty

TrayIconSourceProperty

DependencyProperty

Identifies the TrayIconSource dependency property.

C#
public static readonly DependencyProperty TrayIconSourceProperty

UseNativeTooltipProperty

DependencyProperty

Identifies the UseNativeTooltip dependency property.

C#
public static readonly DependencyProperty UseNativeTooltipProperty

Properties

Gets or sets the icon of the balloon tip to be show when the ShowBalloonTip(int) method is called. This is a dependency property.

C#
public Icon BalloonIcon { get; set; }

Gets or sets the icon of the balloon tip to be show when the ShowBalloonTip(int) method is called. This is a dependency property.

C#
public ImageSource BalloonIconSource { get; set; }

Gets or sets the text of the balloon tip to be show when the ShowBalloonTip(int) method is called. This is a dependency property.

C#
public string BalloonText { get; set; }

Gets or sets the title of the balloon tip to be show when the ShowBalloonTip(int) method is called. This is a dependency property.

C#
public string BalloonTitle { get; set; }

Gets or sets the mouse action that must be performed over the notify icon to show the TrayContextMenu. This is a dependency property.

C#
public MouseActivationEvent ContextMenuActivationMouseEvent { get; set; }

Gets or sets the Guid id that will be used to identify the notify icon when sending messages to it. This is a dependency property.

C#
public Guid GuidItem { get; set; }

Gets a value indicating whether a popup is open.

C#
public bool IsPopupOpen { get; }

Gets a value indicating whether a custom tooltip is open.

C#
public bool IsTooltipOpen { get; }

Gets or sets the mouse action that must be performed over the notify icon to show a popup with PopupContent. This is a dependency property.

C#
public MouseActivationEvent PopupActivationMouseEvent { get; set; }

Gets or sets the mode in which the popup closes. This is a dependency property.

C#
public PopupCloseMode PopupCloseMode { get; set; }

Gets or sets the content of the popup that the notify icon shows when the PopupActivationMouseEvent is performed. This is a dependency property.

C#
public object PopupContent { get; set; }

Gets or sets the content template for the popup that the notify icon shows when the PopupActivationMouseEvent is performed. This is a dependency property.

C#
public DataTemplate PopupContentTemplate { get; set; }

Gets or sets the animation played when hiding the popup.

C#
public RadAnimation PopupHideAnimation { get; set; }

Gets or sets the animation played when opening the popup.

C#
public RadAnimation PopupShowAnimation { get; set; }

Gets or sets the amount of time in milliseconds after which the popup will begin to close automatically. This is a dependency property.

C#
public int PopupShowDuration { get; set; }

Gets or sets whether the icon is visible in the notification area. This is a dependency property.

C#
public bool ShowTrayIcon { get; set; }

Gets or sets the content of the tooltip that will be shown when the mouse hovers over the notify icon. This is a dependency property.

C#
public object TooltipContent { get; set; }

Gets or sets the content template for the tooltip that will be shown when the mouse hovers over the notify icon. This is a dependency property.

C#
public DataTemplate TooltipContentTemplate { get; set; }

Gets or sets the context menu to be shown when the ContextMenuActivationMouseEvent is performed. This is a dependency property.

C#
public RadContextMenu TrayContextMenu { get; set; }

Gets or sets the icon to be displayed in the windows notification area. This is a dependency property.

C#
public Icon TrayIcon { get; set; }

TrayIconSource

ImageSource

Gets or sets the icon to be displayed in the windows notification area. This is a dependency property.

C#
public ImageSource TrayIconSource { get; set; }

Gets or sets whether a native tooltip [true] or the TooltipContent and/or TooltipContentTemplate [false] will be shown when the mouse hovers over the notify icon. If set to [true] the TooltipContent property should be set to a string value. This is a dependency property.

C#
public bool UseNativeTooltip { get; set; }

Methods

Adds the notify icon to the Windows notification area.

C#
public void AddIcon()

Disposes any resources this instance holds.

C#
public void Dispose()

Implements: IDisposable.Dispose()

Disposes any resources this instance holds.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

Releases unmanaged resources and performs other cleanup operations before the RadNotifyIcon is reclaimed by garbage collection.

C#
protected override void Finalize()

Checks the state of the computer for the current user to determine whether sending a notification is appropriate.

C#
public static UserNotificationState GetUserNotificationState()
Returns:

UserNotificationState

The state of the computer for the current user.

Hides the balloon tip.

C#
public void HideBalloonTip()

Hides the popup.

C#
public void HidePopup()

Measurement override. Implement your size-to-content logic here.

C#
protected override Size MeasureOverride(Size availableSize)
Parameters:availableSizeSize

Available size that parent can give to the child.

Returns:

Size

Desired Size of the control, given available size passed as parameter.

Fires the BalloonTipClicked event.

C#
protected virtual void OnBalloonTipClicked()

Fires the BalloonTipClosed event.

C#
protected virtual void OnBalloonTipClosed()

Fires the BalloonTipShown event.

C#
protected virtual void OnBalloonTipShown()

Fires the PopupOpened event.

C#
protected virtual void OnPopupOpened(EventArgs e)
Parameters:eEventArgs

The event arguments.

Fires the PopupOpening event.

C#
protected virtual void OnPopupOpening(NotifyIconPopupOpeningEventArgs e)
Parameters:eNotifyIconPopupOpeningEventArgs

The event arguments.

Fires the PreviewTooltipOpened event.

C#
protected virtual void OnPreviewTooltipOpened(CancelEventArgs e)
Parameters:eCancelEventArgs

The event arguments.

Notification that a specified property has been changed.

C#
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters:eDependencyPropertyChangedEventArgs

EventArgs that contains the property, metadata, old value, and new value for this change.

Fires the Selected event.

C#
protected virtual void OnSelected(NotifyIconSelectedEventArgs e)
Parameters:eNotifyIconSelectedEventArgs

The event arguments.

Fires the TooltipOpened event.

C#
protected virtual void OnTooltipOpened(EventArgs e)
Parameters:eEventArgs

The event arguments.

Fires the TrayContextMenuOpened event.

C#
protected virtual void OnTrayContextMenuOpened(EventArgs e)
Parameters:eEventArgs

The event arguments.

Fires the TrayContextMenuOpening event.

C#
protected virtual void OnTrayContextMenuOpening(CancelEventArgs e)
Parameters:eCancelEventArgs

The event arguments.

Fires the TrayIconMouseClick event.

C#
protected virtual void OnTrayIconMouseClick(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The event arguments.

Fires the TrayIconMouseDoubleClick event.

C#
protected virtual void OnTrayIconMouseDoubleClick(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The event arguments.

Fires the TrayIconMouseDown event.

C#
protected virtual void OnTrayIconMouseDown(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The event arguments.

Fires the TrayIconMouseMove event.

C#
protected virtual void OnTrayIconMouseMove(MouseEventArgs e)
Parameters:eMouseEventArgs

The event arguments.

Fires the TrayIconMouseUp event.

C#
protected virtual void OnTrayIconMouseUp(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The event arguments.

Removes the icon from the Windows notification area.

C#
public void RemoveIcon()

Shows a balloon tip with the settings defined in the BalloonTitle, BalloonTitle and BalloonIcon properties.

C#
public void ShowBalloonTip(int timeout = 10)
Parameters:timeoutint

The amount of seconds to wait before the balloon auto hides. The system minimum and maximum are 10 and 30 seconds. Note this parameter has effect only in Windows 2000 and Windows XP. More information here https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa.

Shows a balloon tip.

C#
public void ShowBalloonTip(string title, string text, BalloonTipIcon icon, bool doNotPlaySound = false, int timeout = 10)
Parameters:titlestring

The title of the balloon tip.

textstring

The text of the balloon tip.

iconBalloonTipIcon

The icon of the balloon tip.

doNotPlaySoundbool

Whether sound should be played when showing the balloon tip.

timeoutint

The amount of seconds to wait before the balloon auto hides. The system minimum and maximum are 10 and 30 seconds. Note this parameter has effect only in Windows 2000 and Windows XP. More information here https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa.

Shows a balloon tip.

C#
public void ShowBalloonTip(string title, string text, Icon icon, bool useLargeIcon = true, bool doNotPlaySound = false, int timeout = 10)
Parameters:titlestring

The title of the balloon tip.

textstring

The text of the balloon tip.

iconIcon

The icon of the balloon tip.

useLargeIconbool

Whether the large version of the provided icon should be used.

doNotPlaySoundbool

Whether sound should be played when showing the balloon tip.

timeoutint

The amount of seconds to wait before the balloon auto hides. The system minimum and maximum are 10 and 30 seconds. Note this parameter has effect only in Windows 2000 and Windows XP. More information here https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa.

Shows the popup next to the notify icon, depending on edge of the screen where the taskbar is located.

C#
public void ShowPopup()

Shows the popup at the provided location.

C#
public void ShowPopup(Point location)
Parameters:locationPoint

The coordinates where the popup should be opened.

Sends an update message to the notify icon.

C#
public void UpdateIcon()

Events

Occurs when the user clicks on a balloon tip.

C#
public event EventHandler BalloonTipClicked

Occurs when a balloon tip is closed.

C#
public event EventHandler BalloonTipClosed

Occurs when a balloon tip is shown.

C#
public event EventHandler BalloonTipShown

Occurs when the popup of the RadNotifyIcon is opened.

C#
public event EventHandler PopupOpened

Occurs before the popup of the RadNotifyIcon is opened.

C#
public event EventHandler<NotifyIconPopupOpeningEventArgs> PopupOpening

Occurs before the custom tooltip of the RadNotifyIcon is opened.

C#
public event CancelEventHandler PreviewTooltipOpened

Occurs when the user selects a RadNotifyIcon in the Windows notification area.

C#
public event EventHandler<NotifyIconSelectedEventArgs> Selected

Occurs when the custom tooltip of the RadNotifyIcon is opened.

C#
public event EventHandler TooltipOpened

Occurs when the context menu of the RadNotifyIcon is opened.

C#
public event EventHandler TrayContextMenuOpened

Occurs before the context menu of the RadNotifyIcon is opened.

C#
public event CancelEventHandler TrayContextMenuOpening

TrayIconMouseClick

MouseButtonEventHandler

Occurs when the user clicks on the notify icon.

C#
public event MouseButtonEventHandler TrayIconMouseClick

TrayIconMouseDoubleClick

MouseButtonEventHandler

Occurs when the user double clicks on the notify icon.

C#
public event MouseButtonEventHandler TrayIconMouseDoubleClick

TrayIconMouseDown

MouseButtonEventHandler

Occurs when the user presses a mouse button over the notify icon.

C#
public event MouseButtonEventHandler TrayIconMouseDown

TrayIconMouseMove

MouseEventHandler

Occurs when the user moves the mouse over the notify icon.

C#
public event MouseEventHandler TrayIconMouseMove

TrayIconMouseUp

MouseButtonEventHandler

Occurs when the user releases a mouse button over the notify icon.

C#
public event MouseButtonEventHandler TrayIconMouseUp
In this article
DefinitionConstructorsRadNotifyIcon()FieldsBalloonIconPropertyBalloonIconSourcePropertyBalloonTextPropertyBalloonTitlePropertyContextMenuActivationMouseEventPropertyGuidItemPropertyPopupActivationMouseEventPropertyPopupCloseModePropertyPopupContentPropertyPopupContentTemplatePropertyPopupShowDurationPropertyShowTrayIconPropertyTooltipContentPropertyTooltipContentTemplatePropertyTrayContextMenuPropertyTrayIconPropertyTrayIconSourcePropertyUseNativeTooltipPropertyPropertiesBalloonIconBalloonIconSourceBalloonTextBalloonTitleContextMenuActivationMouseEventGuidItemIsPopupOpenIsTooltipOpenPopupActivationMouseEventPopupCloseModePopupContentPopupContentTemplatePopupHideAnimationPopupShowAnimationPopupShowDurationShowTrayIconTooltipContentTooltipContentTemplateTrayContextMenuTrayIconTrayIconSourceUseNativeTooltipMethodsAddIcon()Dispose()Dispose(bool)Finalize()GetUserNotificationState()HideBalloonTip()HidePopup()MeasureOverride(Size)OnBalloonTipClicked()OnBalloonTipClosed()OnBalloonTipShown()OnPopupOpened(EventArgs)OnPopupOpening(NotifyIconPopupOpeningEventArgs)OnPreviewTooltipOpened(CancelEventArgs)OnPropertyChanged(DependencyPropertyChangedEventArgs)OnSelected(NotifyIconSelectedEventArgs)OnTooltipOpened(EventArgs)OnTrayContextMenuOpened(EventArgs)OnTrayContextMenuOpening(CancelEventArgs)OnTrayIconMouseClick(MouseButtonEventArgs)OnTrayIconMouseDoubleClick(MouseButtonEventArgs)OnTrayIconMouseDown(MouseButtonEventArgs)OnTrayIconMouseMove(MouseEventArgs)OnTrayIconMouseUp(MouseButtonEventArgs)RemoveIcon()ShowBalloonTip(int)ShowBalloonTip(string, string, BalloonTipIcon, bool, int)ShowBalloonTip(string, string, Icon, bool, bool, int)ShowPopup()ShowPopup(Point)UpdateIcon()EventsBalloonTipClickedBalloonTipClosedBalloonTipShownPopupOpenedPopupOpeningPreviewTooltipOpenedSelectedTooltipOpenedTrayContextMenuOpenedTrayContextMenuOpeningTrayIconMouseClickTrayIconMouseDoubleClickTrayIconMouseDownTrayIconMouseMoveTrayIconMouseUp
Not finding the help you need?
Contact Support