TrayVisible Property

Sets or returns whether the icon is visible in the system tray. See also the TrayShow and TrayHide methods.

Syntax

csSysTray[(index)].TrayVisible [= boolean]

The TrayVisible property syntax has these parts:

Part Description
csSysTray The SysTray control you are working with, or a control array of SysTray controls.
boolean A Boolean expression specifying whether the system tray icon is visible or hidden.

Settings

The settings for boolean are:

Setting Description
True (Default) The system tray icon is visible (when the form that contains it is loaded).
False The system tray icon is hidden.

Examples

Example 1 (showing/hiding the system tray icon at run time)

csSysTray1.TrayVisible = True

Example 2 (retrieving the visible state of the system tray icon at run time)

trayiconVisible = csSysTray1.TrayVisible


Remarks

To hide a system tray icon at startup, set the TrayVisible property to False at design time. Setting this property in code enables you to hide and later redisplay a system tray icon at run time in response to a particular event.

Note Using the TrayShow or TrayHide method on a SysTray control is the same as setting the control's TrayVisible property in code to True or False, respectively.