ClassRadNotifyIcon
Represents a control that can be used to display an icon in the Windows' taskbar notification area. The icon can then respond to user interaction as well as display tooltips, popups, balloon notifications and context menu.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Containers")]
public class RadNotifyIcon : Component, IComponent, IDisposable
Inheritance: objectMarshalByRefObjectComponentRadNotifyIcon
Implements:
Inherited Members
Constructors
RadNotifyIcon()
Initializes a new instance of the RadNotifyIcon class.
Declaration
public RadNotifyIcon()
Properties
BalloonIcon
Gets or sets the icon of the balloon tip to be show when the ShowBalloonTip(int) method is called.
Declaration
[Browsable(true)]
public Icon BalloonIcon { get; set; }
Property Value
BalloonText
Gets or sets the text of the balloon tip to be show when the ShowBalloonTip(int) method is called.
Declaration
[Browsable(true)]
public string BalloonText { get; set; }
Property Value
BalloonTitle
Gets or sets the title of the balloon tip to be show when the ShowBalloonTip(int) method is called.
Declaration
[Browsable(true)]
public string BalloonTitle { get; set; }
Property Value
ContextMenuActivationMouseEvent
Gets or sets the mouse action that must be performed over the notify icon to show the TrayContextMenu.
Declaration
[Browsable(true)]
public MouseActivationEvent ContextMenuActivationMouseEvent { get; set; }
Property Value
GuidItem
Gets or sets the Guid id that will be used to identify the notify icon when sending messages to it.
Declaration
[Browsable(true)]
public Guid GuidItem { get; set; }
Property Value
IsPopupOpen
Gets a value indicating whether a popup is open.
Declaration
[Browsable(false)]
public bool IsPopupOpen { get; }
Property Value
PopupActivationMouseEvent
Gets or sets the mouse action that must be performed over the notify icon to show a popup with PopupContent.
Declaration
[Browsable(true)]
public MouseActivationEvent PopupActivationMouseEvent { get; set; }
Property Value
PopupCloseMode
Gets or sets the mode in which the popup closes.
Declaration
[Browsable(true)]
public PopupCloseMode PopupCloseMode { get; set; }
Property Value
PopupContent
Gets or sets the control that is set as the content of the popup which the notify icon shows when the PopupActivationMouseEvent is performed.
Declaration
[Browsable(true)]
public Control PopupContent { get; set; }
Property Value
PopupHideAnimation
Gets or sets the animation played when hiding the popup.
Declaration
[Browsable(true)]
public NotifyIconAnimationType PopupHideAnimation { get; set; }
Property Value
PopupShowAnimation
Gets or sets the animation played when opening the popup.
Declaration
[Browsable(true)]
public NotifyIconAnimationType PopupShowAnimation { get; set; }
Property Value
PopupShowDuration
Gets or sets the amount of time in milliseconds after which the popup will begin to close automatically.
Declaration
[Browsable(true)]
public int PopupShowDuration { get; set; }
Property Value
ShowTrayIcon
Gets or sets whether the icon is visible in the notification area.
Declaration
[Browsable(true)]
public bool ShowTrayIcon { get; set; }
Property Value
ThemeName
Gets or sets theme name.
Declaration
[Browsable(true)]
public string ThemeName { get; set; }
Property Value
TooltipText
Gets or sets the tooltip that will be shown when the mouse hovers over the notify icon.
Declaration
[Browsable(true)]
public string TooltipText { get; set; }
Property Value
TrayContextMenu
Gets or sets the context menu to be shown when the ContextMenuActivationMouseEvent is performed.
Declaration
[Browsable(true)]
public RadContextMenu TrayContextMenu { get; set; }
Property Value
Methods
AddIcon()
Adds the notify icon to the Windows notification area.
Declaration
public void AddIcon()
Dispose(bool)
Disposes any resources this instance holds.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
Overrides
GetUserNotificationState()
Checks the state of the computer for the current user to determine whether sending a notification is appropriate.
Declaration
public static UserNotificationState GetUserNotificationState()
Returns
The state of the computer for the current user.
OnBalloonTipClicked()
Fires the BalloonTipClicked event.
Declaration
protected virtual void OnBalloonTipClicked()
OnBalloonTipClosed()
Fires the BalloonTipClosed event.
Declaration
protected virtual void OnBalloonTipClosed()
OnBalloonTipShown()
Fires the BalloonTipShown event.
Declaration
protected virtual void OnBalloonTipShown()
OnPopupOpened(EventArgs)
Fires the PopupOpened event.
Declaration
protected virtual void OnPopupOpened(EventArgs e)
Parameters
e
The event arguments.
OnPopupOpening(NotifyIconPopupOpeningEventArgs)
Fires the PopupOpening event.
Declaration
protected virtual void OnPopupOpening(NotifyIconPopupOpeningEventArgs e)
Parameters
e
NotifyIconPopupOpeningEventArgs
The event arguments.
OnSelected(NotifyIconSelectedEventArgs)
Fires the Selected event.
Declaration
protected virtual void OnSelected(NotifyIconSelectedEventArgs e)
Parameters
e
The event arguments.
OnTrayContextMenuOpened(EventArgs)
Fires the TrayContextMenuOpened event.
Declaration
protected virtual void OnTrayContextMenuOpened(EventArgs e)
Parameters
e
The event arguments.
OnTrayContextMenuOpening(CancelEventArgs)
Fires the TrayContextMenuOpening event.
Declaration
protected virtual void OnTrayContextMenuOpening(CancelEventArgs e)
Parameters
e
The event arguments.
OnTrayIconMouseClick(MouseEventArgs)
Fires the TrayIconMouseClick event.
Declaration
protected virtual void OnTrayIconMouseClick(MouseEventArgs e)
Parameters
e
The event arguments.
OnTrayIconMouseDoubleClick(MouseEventArgs)
Fires the TrayIconMouseDoubleClick event.
Declaration
protected virtual void OnTrayIconMouseDoubleClick(MouseEventArgs e)
Parameters
e
The event arguments.
OnTrayIconMouseDown(MouseEventArgs)
Fires the TrayIconMouseDown event.
Declaration
protected virtual void OnTrayIconMouseDown(MouseEventArgs e)
Parameters
e
The event arguments.
OnTrayIconMouseMove(MouseEventArgs)
Fires the TrayIconMouseMove event.
Declaration
protected virtual void OnTrayIconMouseMove(MouseEventArgs e)
Parameters
e
The event arguments.
OnTrayIconMouseUp(MouseEventArgs)
Fires the TrayIconMouseUp event.
Declaration
protected virtual void OnTrayIconMouseUp(MouseEventArgs e)
Parameters
e
The event arguments.
RemoveIcon()
Removes the icon from the Windows notification area.
Declaration
public void RemoveIcon()
ShowBalloonTip(int)
Shows a balloon tip with the settings defined in the BalloonTitle, BalloonTitle and BalloonIcon properties.
Declaration
public void ShowBalloonTip(int timeout = 10)
Parameters
timeout
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.
ShowBalloonTip(string, string, BalloonTipIcon, bool, int)
Shows a balloon tip.
Declaration
public void ShowBalloonTip(string title, string text, BalloonTipIcon icon, bool doNotPlaySound = false, int timeout = 10)
Parameters
title
The title of the balloon tip.
text
The text of the balloon tip.
icon
The icon of the balloon tip.
doNotPlaySound
Whether sound should be played when showing the balloon tip.
timeout
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.
ShowBalloonTip(string, string, Icon, bool, int)
Shows a balloon tip.
Declaration
public void ShowBalloonTip(string title, string text, Icon icon, bool doNotPlaySound = false, int timeout = 10)
Parameters
title
The title of the balloon tip.
text
The text of the balloon tip.
icon
The icon of the balloon tip.
doNotPlaySound
Whether sound should be played when showing the balloon tip.
timeout
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.
ShowPopup()
Shows the popup next to the notify icon, depending on edge of the screen where the taskbar is located.
Declaration
public void ShowPopup()
ShowPopup(Point)
Shows the popup at the provided location.
Declaration
public void ShowPopup(Point location)
Parameters
location
The coordinates where the popup should be opened.
UpdateIcon()
Sends an update message to the notify icon.
Declaration
public void UpdateIcon()
~RadNotifyIcon()
Releases unmanaged resources and performs other cleanup operations before the RadNotifyIcon is reclaimed by garbage collection.
Declaration
protected ~RadNotifyIcon()
Events
BalloonTipClicked
Occurs when the user clicks on a balloon tip.
BalloonTipClosed
Occurs when a balloon tip is closed.
BalloonTipShown
Occurs when a balloon tip is shown.
PopupOpened
Occurs when the popup of the RadNotifyIcon is opened.
PopupOpening
Occurs before the popup of the RadNotifyIcon is opened.
Declaration
public event EventHandler<NotifyIconPopupOpeningEventArgs> PopupOpening
Event Value
Selected
Occurs when the user selects a RadNotifyIcon in the Windows notification area.
Declaration
public event EventHandler<NotifyIconSelectedEventArgs> Selected
Event Value
TrayContextMenuOpened
Occurs when the context menu of the RadNotifyIcon is opened.
Declaration
public event EventHandler TrayContextMenuOpened
Event Value
TrayContextMenuOpening
Occurs before the context menu of the RadNotifyIcon is opened.
Declaration
public event CancelEventHandler TrayContextMenuOpening
Event Value
TrayIconMouseClick
Occurs when the user clicks on the notify icon.
Declaration
public event MouseEventHandler TrayIconMouseClick
Event Value
TrayIconMouseDoubleClick
Occurs when the user double clicks on the notify icon.
Declaration
public event MouseEventHandler TrayIconMouseDoubleClick
Event Value
TrayIconMouseDown
Occurs when the user presses a mouse button over the notify icon.
Declaration
public event MouseEventHandler TrayIconMouseDown
Event Value
TrayIconMouseMove
Occurs when the user moves the mouse over the notify icon.
Declaration
public event MouseEventHandler TrayIconMouseMove
Event Value
TrayIconMouseUp
Occurs when the user releases a mouse button over the notify icon.
Declaration
public event MouseEventHandler TrayIconMouseUp
Event Value