|
This object allows you put and control icons in the shell/system
notification area (often called System Tray).
The usage cycle of the object most often follows this pattern:
1. One or more bitmaps are added to the object (see AddImage)
2. At certain point the application puts an icon from the loaded
bitmaps into the tray (See Image property).
3. The application handles user actions over the icon in the tray
(see the events).
4. The application removes the image from the tray (object.Image =
0).
Do not forget to remove the image from the tray before the
application exits or earlier if appropriate. Otherwise the image
will remain there until the user passes with the mouse over it or
until the shell is restarted (on some CE devices).
If you need more than one tray icons you need the same number of
Tray objects in your application - each controlling one of the tray
icons.
Hint. By using bitmaps containing many icons you can
implement animation or dynamic state indication in the tray.
Changing the Image property at run time will immediately change the
icon the user sees.
Note that on devices/systems with touch screens only Click and
DblClick events can actually occur. Although some of these systems
may support hold action internally translated to right mouse click
this is not common for the system tray support and you cannot count
on it when you write code that must run on different touch screen
based systems.
Members reference
| Name |
Syntax |
Description |
Image |
object.Image = value
variable = object.Image |
Type: Numeric
Specifies an index of an image/icon in the bitmap (See
AddImage). When set it puts the specified image index into the
system tray or returns the index of the currently shown image.
If an image is already shown in the system tray putting new
index will change it giving you the opportunity to implement
animations or application state indication in the system
tray. |
Tag |
object.Tag = value
variable = object.Tag |
An application specified
value for its custom usage. |
Version |
variable = object.Version |
Returns the object version. |
AddImage |
image_index =
object.AddImage(bitmapfile_path) |
Loads a set of icons/images
to the object. The images are in a bitmap. Most often 16x16
images are used. If you want to have 4 different images you
put 4 such images in a single bitmap with size 64x16 from left
to right. Then the first image has index 1 and so forth. |
RemoveImage |
object.RemoveImage(image_index) |
Removes an image previously
loaded with AddImage. Use the returned image_index from it to
address it. |
Tip |
object.Tip =
tool_tip_text
variable = object.Tip |
Specifies the tool tip for
the tray icon |
Click |
Sub
object_Click(sender) |
The user has clicked the tray
icon with the left mouse button or has pressed space key over
it. |
RClick |
Sub object_RClick(sender) |
The user has clicked the tray
icon with the right mouse button |
DblClick |
Sub object_DblClick(sender) |
The user has double clicked
the tray icon with the left mouse button or has pressed the
Enter key over it. |
RDblClick |
Sub object_RDblClick(sender) |
The user has double clicked
the tray icon with the right mouse button. |
KeyDown |
Sub object_KeyDown(sender) |
reserved for future use. |
|