10Tec Company
top bar image
Free Newsletter
Your e-mail:


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 = ImgList.ItemIndex("open_mail")
End Sub

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

 
In this section:
Download Demo
  Back to Top
Visit our partners:
Visual Basic News & Information Source Tools and components for software developers ViewSlip - Perfest products for your business! Quality Tools for Serious Microsoft Developers Shareup Networks Downloads vbAccelerator.com Download software from TopShareware.com Shareware and Freeware downloads and tested, rated and reviewed software submitted by software author.
Everything Visual Basic, from Visual Basic 3 to Visual Basic Xml Upload.com: a web service for promoting and selling software online
© 10Tec Company. Last updated: 20 Mar 2008