RadNotifyIcon
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:
Constructors
Initializes a new instance of the RadNotifyIcon class.
public RadNotifyIcon()
Properties
Gets or sets the icon of the balloon tip to be show when the ShowBalloonTip(int) method is called.
[Browsable(true)]
public Icon BalloonIcon { get; set; }
Gets or sets the text of the balloon tip to be show when the ShowBalloonTip(int) method is called.
[Browsable(true)]
public string BalloonText { get; set; }
Gets or sets the title of the balloon tip to be show when the ShowBalloonTip(int) method is called.
[Browsable(true)]
public string BalloonTitle { get; set; }
Gets or sets the mouse action that must be performed over the notify icon to show the TrayContextMenu.
[Browsable(true)]
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.
[Browsable(true)]
public Guid GuidItem { get; set; }
Gets a value indicating whether a popup is open.
[Browsable(false)]
public bool IsPopupOpen { get; }
Gets or sets the mouse action that must be performed over the notify icon to show a popup with PopupContent.
[Browsable(true)]
public MouseActivationEvent PopupActivationMouseEvent { get; set; }
Gets or sets the mode in which the popup closes.
[Browsable(true)]
public PopupCloseMode PopupCloseMode { get; set; }
Gets or sets the control that is set as the content of the popup which the notify icon shows when the PopupActivationMouseEvent is performed.
[Browsable(true)]
public Control PopupContent { get; set; }
Gets or sets the animation played when hiding the popup.
[Browsable(true)]
public NotifyIconAnimationType PopupHideAnimation { get; set; }
Gets or sets the animation played when opening the popup.
[Browsable(true)]
public NotifyIconAnimationType PopupShowAnimation { get; set; }
Gets or sets the amount of time in milliseconds after which the popup will begin to close automatically.
[Browsable(true)]
public int PopupShowDuration { get; set; }
Gets or sets whether the icon is visible in the notification area.
[Browsable(true)]
public bool ShowTrayIcon { get; set; }
Gets or sets the tooltip that will be shown when the mouse hovers over the notify icon.
[Browsable(true)]
public string TooltipText { get; set; }
Gets or sets the context menu to be shown when the ContextMenuActivationMouseEvent is performed.
[Browsable(true)]
public RadContextMenu TrayContextMenu { get; set; }
Methods
Releases unmanaged resources and performs other cleanup operations before the RadNotifyIcon is reclaimed by garbage collection.
protected ~RadNotifyIcon()
Adds the notify icon to the Windows notification area.
public void AddIcon()
Disposes any resources this instance holds.
Checks the state of the computer for the current user to determine whether sending a notification is appropriate.
public static UserNotificationState GetUserNotificationState()
The state of the computer for the current user.
Hides the balloon tip.
public void HideBalloonTip()
Hides the popup.
public void HidePopup()
Fires the BalloonTipClicked event.
protected virtual void OnBalloonTipClicked()
Fires the BalloonTipClosed event.
protected virtual void OnBalloonTipClosed()
Fires the BalloonTipShown event.
protected virtual void OnBalloonTipShown()
Fires the PopupOpened event.
Fires the PopupOpening event.
protected virtual void OnPopupOpening(NotifyIconPopupOpeningEventArgs e)
The event arguments.
Fires the Selected event.
protected virtual void OnSelected(NotifyIconSelectedEventArgs e)
The event arguments.
Fires the TrayContextMenuOpened event.
protected virtual void OnTrayContextMenuOpened(EventArgs e)
The event arguments.
Fires the TrayContextMenuOpening event.
protected virtual void OnTrayContextMenuOpening(CancelEventArgs e)
The event arguments.
Fires the TrayIconMouseClick event.
protected virtual void OnTrayIconMouseClick(MouseEventArgs e)
The event arguments.
Fires the TrayIconMouseDoubleClick event.
protected virtual void OnTrayIconMouseDoubleClick(MouseEventArgs e)
The event arguments.
Fires the TrayIconMouseDown event.
protected virtual void OnTrayIconMouseDown(MouseEventArgs e)
The event arguments.
Fires the TrayIconMouseMove event.
protected virtual void OnTrayIconMouseMove(MouseEventArgs e)
The event arguments.
Fires the TrayIconMouseUp event.
protected virtual void OnTrayIconMouseUp(MouseEventArgs e)
The event arguments.
Removes the icon from the Windows notification area.
public void RemoveIcon()
Shows a balloon tip with the settings defined in the BalloonTitle, BalloonTitle and BalloonIcon properties.
public void ShowBalloonTip(int timeout = 10)
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.
public void ShowBalloonTip(string title, string text, BalloonTipIcon icon, bool doNotPlaySound = false, int timeout = 10)
The title of the balloon tip.
textstringThe text of the balloon tip.
iconBalloonTipIconThe icon of the balloon tip.
doNotPlaySoundboolWhether sound should be played when showing the balloon tip.
timeoutintThe 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.
public void ShowBalloonTip(string title, string text, Icon icon, bool doNotPlaySound = false, int timeout = 10)
The title of the balloon tip.
textstringThe text of the balloon tip.
iconIconThe icon of the balloon tip.
doNotPlaySoundboolWhether sound should be played when showing the balloon tip.
timeoutintThe 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.
public void ShowPopup()
Shows the popup at the provided location.
public void ShowPopup(Point location)
The coordinates where the popup should be opened.
Sends an update message to the notify icon.
public void UpdateIcon()
Events
Occurs when the user clicks on a balloon tip.
public event EventHandler BalloonTipClicked
Occurs when a balloon tip is closed.
public event EventHandler BalloonTipClosed
Occurs when a balloon tip is shown.
public event EventHandler BalloonTipShown
Occurs when the popup of the RadNotifyIcon is opened.
public event EventHandler PopupOpened
Occurs before the popup of the RadNotifyIcon is opened.
public event EventHandler<NotifyIconPopupOpeningEventArgs> PopupOpening
Occurs when the user selects a RadNotifyIcon in the Windows notification area.
public event EventHandler<NotifyIconSelectedEventArgs> Selected
Occurs when the context menu of the RadNotifyIcon is opened.
public event EventHandler TrayContextMenuOpened
Occurs before the context menu of the RadNotifyIcon is opened.
public event CancelEventHandler TrayContextMenuOpening
Occurs when the user clicks on the notify icon.
public event MouseEventHandler TrayIconMouseClick
Occurs when the user double clicks on the notify icon.
public event MouseEventHandler TrayIconMouseDoubleClick
Occurs when the user presses a mouse button over the notify icon.
public event MouseEventHandler TrayIconMouseDown
Occurs when the user moves the mouse over the notify icon.
public event MouseEventHandler TrayIconMouseMove
Occurs when the user releases a mouse button over the notify icon.
public event MouseEventHandler TrayIconMouseUp