Programming CaptionX Control

All you need to do to display your own icons with CaptionX is to link this control to an image list with the ImageList property and define caption icons using the Add method of the Icons collection. For instance, the icon under the pointer on the screenshot above was created using the following statement:

CaptionX1.Icons.Add _
   ImageIndex:=1, _
   Key:="mail", _
   ToolTipText:="Click this icon to write a letter" & _
      vbCrLf & "to 10Tec Company", _
   ToolTipTitle:="Write a letter", ToolTipIcon:=ttiInfo

Each caption icon raises the following events: Click (when the user clicks an icon), MouseEnter and MouseLeave (when the mouse pointer enters and leaves the area occupied by a caption icon). CaptionX also raises the CustomDrawTitle event you can use to draw your own title text and images when you set the CustomDrawing property to True.

CaptionX event and object model allows you to implement a lot of tasks. For instance, you can display your own tips for caption icons in window status bar or highlight them when the user moves the pointer over them using the MouseEnter event. The Click event can be used to change an icon glyph; in this case the code may look like the following:

Private Sub CaptionX1_Click(ByVal IconIndex As Long)
   CaptionX1.Icons("mail").ImageIndex = _
End Sub

You can also change caption icon tooltips dynamically, set a window's caption text periodically by timer events and so forth.