Welcome to the DevPower Web Site
  home   |  support   |  shop   |  downloads   |  about devpower 

DevPower Button Bar ActiveX Control Version 2.0.1 (06-Aug-01)

Copyright (c) 1998 - 2017 Steve Robbins All Rights Reserved.

Documentation

Control Properties

  • AlwaysShowFirstHeader Boolean
    Whether the control should hide the top Header if only one Header is being used.
  • AutoMouseWheel Boolean
    Whether the control automatically grab focus so that Mouse Wheels work correctly - MSDN states that only windows with focus will receive WM_MOUSEWHEEL, so this property ensures that Mouse Wheel events are received.
  • BackColor OleColor
    Sets the background color of the control.
  • CheckColor OleColor
    Sets the color to draw check patterns with.
  • DefaultMaskColor OleColor
    Sets the default mask color for drawing item pictures.
  • DkShadowColor OleColor
    Sets the dark shadow color.
  • FlashDelay Long
    Gets / Sets the delay (in MS) between flashes by Header.Flash()
  • Font Font
    Sets the font to use for the Header and Item captions.
  • Headers Headers (Read Only / Default Member)
    Returns the Collection of Headers through which all Header properties can be set and access to items on Headers can be gained easily.
    See Objects below.
  • HeaderBackColor OleColor
    Sets the color of the Headers.
  • HeaderHeight Integer
    Returns the current height of Headers.
  • HeaderMouseIcon OleObject
    Sets the cursor to display when the mouse is over an item.
  • HeaderMousePointer Integer
    Sets one of the standard windows cursors to be displayed when the mouse is over an item (as with Visual Basic Controls);
    1 Arrow.
    2 Cross (crosshair pointer).
    3 I beam.
    4 Icon (small square within a square).
    5 Size (four-pointed arrow pointing north, south, east, and west).
    6 Size NE SW (double arrow pointing northeast and southwest).
    7 Size N S (double arrow pointing north and south).
    8 Size NW SE (double arrow pointing northwest and southeast).
    9 Size W E (double arrow pointing west and east).
    10 Up Arrow.
    11 Hourglass (wait).
    12 No Drop.
    13 Arrow and hourglass.
    14 Arrow and question mark.
    15 Size all.
    99 Custom icon specified by the MouseIcon
  • HeaderForeColor OleColor
    Sets the color of the captions on the Headers.
  • HeaderOverForeColor OleColor
    Sets the Header Caption color when the mouse is over them.
  • HighlightColor OleColor
    Sets the highlight color.
  • hWnd Long
    Gets the Controls Window Handle.
  • Icons Object
    Gets / Sets the large image list.
  • ItemForeColor OleColor
    Sets the Item Caption color.
  • ItemDownBackColor OleColor
    Sets the Item background color when the mouse is down.
  • ItemDownForeColor OleColor
    Sets the Item Caption color when the mouse is down.
  • ItemOverBackColor OleColor
    Sets the Item background color when the mouse is over them.
  • ItemOverForeColor OleColor
    Sets the Item Caption color when the mouse is over them.
  • ItemMouseIcon OleObject
    Sets the cursor to display when the mouse is over an item.
  • ItemMousePointer Integer
    Sets one of the standard windows cursors to be displayed when the mouse is over an item (as with Visual Basic Controls);
    1 Arrow.
    2 Cross (crosshair pointer).
    3 I beam.
    4 Icon (small square within a square).
    5 Size (four-pointed arrow pointing north, south, east, and west).
    6 Size NE SW (double arrow pointing northeast and southwest).
    7 Size N S (double arrow pointing north and south).
    8 Size NW SE (double arrow pointing northwest and southeast).
    9 Size W E (double arrow pointing west and east).
    10 Up Arrow.
    11 Hourglass (wait).
    12 No Drop.
    13 Arrow and hourglass.
    14 Arrow and question mark.
    15 Size all.
    99 Custom icon specified by the MouseIcon
  • ItemsMoveWithClick Boolean
    Whether images should move down when items are clicked (like a normal button).
  • ItemsStayDownWithClick Boolean
    Whether items should toggle down when clicked (like MS Project 98).
  • ItemsUnderlineOnMove Boolean
    Whether items display their captions with an underline when the mouse passes over them
  • Navigation clsNavigation
    If the control is recording user navigation (see TrackNavigation below), this object exposes the properties / methods below;
      CanGoBack Boolean - whether there is a previous entry in the history list to go back to.
      CanGoForward Boolean - whether there is an entry in the history list to go forward to.
      CurrentPosition Long - the current position in the history list.
      Enabled Boolean - whether to track user navigation.
      Clear() - Clears the history list.
      HistoryXML() String - Returns the history list in XML (if XML Microsoft parser is available).
      GoBack() - Moves back to the previous entry in the history list.
      GoForward() - Moves forward to the next entry in the history list.
  • OLEDragMode Integer
    Gets / Sets the OLE Drag Mode;
    0 Manual - OLE Drag can only be started by a call to OLEDrag
    1 Automatic - OLE Drag operations are started automatically - set the data in the OLEStartDrag event.
  • OLEDropMode Integer
    Gets / Sets the OLE Drop Mode;
    0 None - No reaction to OLE drag / drop
    1 HeadersOnly - Only Headers react to OLE drag / drop
    2 ItemsOnly - Only Items react to OLE drag / drop
    3 HeadersItems - Both Headers and Items react to OLE drag / drop
  • PlaySounds Boolean
    Whether the control should play Sounds when items are clicked or the current Header is changed.
  • ScrollDelay Integer
    The delay in milliseconds when scrolling the items. The value must be between 10 and 2000, with 150 being the default.
  • SelectedHeader Header
    Gets the currently selected header
  • SelectedItem Item
    Gets the currently selected item
  • ShadowColor OleColor
    Sets the shadow color.
  • ShowToolTips Boolean
    Whether the control should display tooltips when the mouse pauses over Headers and items.
  • SmallIcons Object
    Gets / Sets the small image list.
  • SmoothScroll Boolean
    Whether to scroll items and Headers smoothly, like Outlook 98.
  • SoundItemURL String
    Sets the URL / file location for the sound to be played when an item is clicked.
  • SoundHeaderUpURL String
    Sets the URL / file location for the sound to be played when a Header is moved up.
  • SoundHeaderDownURL String
    Sets the URL / file location for the sound to be played when a Header is moved down.
  • Style bbStyle
    Sets the GUI display style (registered version only). It is recommended that the Style property page is used at design time to adjust other behaviour properties so that the best reproduction is obtained the control.
    0 bbStyleOutlook - default Outlook style (same as version 1.x).
    1 bbStyleWindows2000 - Office / Windows 2000 style (same as version 1.x).
    2 bbStyleOutlookXP - flat XP version of the Outlook style.
    3 bbStyleWindowsXP - flat XP version of the Office 2000 style.
    4 bbStyleVisualStudio - Visual Studio tool box style.
  • URLIcon Picture
    Returns the specified URL Icon.
  • URLSmallIcon Picture
    Returns the specified URL Small Icon.
  • UseSystemSounds Boolean
    Whether the control should play the sounds specified by the user for "Menu Command", "Restore Up" and "Restore Down" or the custom sounds specified by the Sound URL properties.

Control Methods

  • AboutBox ( )
    Displays copyright and version information for the control.
  • GetFirstVisible ( ) Item
    Gets the first visible item within the control.
  • HitTest ( Long X, Long Y ) Item
    Gets the item at the specified location within the selected header.
  • Version ( ) String
    Returns the control version.

Control Events

  • HeaderClick ( Header Header )
    Raised when a header is clicked
  • HeaderMouseDown ( Header Header, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the mouse is held down on a header
  • HeaderMouseMove ( Header Header, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the mouse moves over a header
  • HeaderMouseUp ( Header Header, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the mouse is released over a header
  • HeaderOLECompleteDrag ( Header Header, Long Effect )
    Raised when a header OLEDrag operation completes
  • HeaderOLEDragDrop ( Header Header, DataObject Data, Long Effect, Integer Button, Integer Shift, Single X, Single Y )
    Raised when a the user drops on a header
  • HeaderOLEDragOver ( Header Header, DataObject Data, Long Effect, Integer Button, Integer Shift, Single X, Single Y, Integer State )
    Raised when the user drags over a header
  • HeaderOLEStartDrag ( Header Header, DataObject Data, Long AllowedEffects )
    Raised when a header is about to start an OLEDrag operation
  • HeaderRenamed ( Header Header )
    Raised when a header is renamed by the user
  • IconDownloaded ( String psURL )
    Raised when a URLIcon is downloaded and stored in the internal ImageList
  • ItemClick ( Item Item )
    Raised when an item is clicked
  • ItemMouseDown ( Item Item, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the mouse is held down on an item
  • ItemMouseMove ( Item Item, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the mouse moved over an item
  • ItemMouseUp ( Item Item, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the mouse is released over an item
  • ItemOLECompleteDrag ( Item Item, Long Effect )
    Raised when an item OLE Drag operation completes
  • ItemOLEDragDrop ( Item Item, DataObject Data, Long Effect, Integer Button, Integer Shift, Single X, Single Y )
    Raised when the user drops on an item
  • ItemOLEDragOver ( Item Item, DataObject Data, Long Effect, Integer Button, Integer Shift, Single X, Single Y, Integer State )
    Raised when the user drags over an item
  • ItemOLEStartDrag ( Item Item, DataObject Data, Long AllowedEffects )
    Raised when an OLE Drag operation is about to start
  • ItemRenamed ( Item Item )
    Raised when an item is renamed by the user
  • ScrollUp ( Header Header )
    Raised when the items in the current header have been scrolled up
  • ScrollDown ( Header Header )
    Raised when the items in the current header have been scrolled down
  • SmallIconDownloaded ( String psURL )
    Raised when a URLSmallIcon is downloaded and stored in the internal ImageList


Headers Object

The Headers property of the control returns a Headers object (a collection of Header objects - see MSDN for an overview of how to use collections).

  • Add ( [optional Long Index, optional String Key, optional String Caption, optional bbViewType View] ) Header
    Adds a new Header to the control.
  • Clear ( )
    Removes all headers from the control.
  • Count ( ) Long
    Returns the number of Headers in the control.
  • Exists ( Variant Index ) Boolean
    Returns whether the specified Header exists. The method accepts a key, index or caption as the parameter.
  • Item ( Variant Index ) Header
    Returns the specified Header. This is the default method for the Headers object and accepts a key, index or caption as the parameter.
  • Remove ( Variant Index ) Boolean
    Removes the specified Header. Returns True if the Header was successfully removed.

Header Properties

  • Caption String (Default Member)
    Gets / Sets the caption for the Header.
  • Enabled Boolean
    Gets / Sets whether the Header is enabled.
  • Key String
    Gets / Sets the collection Key for the Header. If no key is specified, a default key will be assigned.
  • Index Long
    Gets / Sets the collection Index for the Header. The Index property dictates the order in which objects are drawn, allowing re-ordering at runtime.
  • Items Items
    Gets the Items collection for the Header - see below.
  • Selected Boolean
    Gets / Sets whether the header is currently active.
  • Tag Variant
    Gets / Sets any variant you need to for the Header.
  • ToolTipText String
    Gets / Sets the tooltip for the Header.
  • View Integer
    Gets / Sets the view for the Header;
    0 LargeIcons.
    1 SmallIcons.
  • Visible Boolean
    Gets / Sets whether the Header is visible.
  • XML String
    Gets / Sets the XML serialization of the header and its contents.

Header Methods

  • Flash(Boolean Enabled [, optional OLE_COLOR FlashColor = ActiveTitleBar, optional OLE_COLOR FlashTextColor = ActiveTitleBarText])
    Starts or stops flashing of the header to attract the users attention.
  • OLEDrag
    Manually starts an OLE drag and drop operation for the Header.
  • StartLabelEdit
    Allows the user to rename the Header. If the user hits escape, no further action is taken, but if they rename the Header and hit enter, the HeaderRenamed event is triggered.

Items Methods

  • Add ( sCaption String [, sURLPicture String, bEnabled as Boolean] ) Item
    Note that versions prior to 1.3.0 return a boolean
    Adds a new item to the Header with the specified caption.
  • Clear ( )
    Removes all items from the header.
  • Count ( ) Long
    Returns the number of Items in the Header.
  • Exists ( Variant Index ) Boolean
    Returns whether the specified Item exists. The method accepts a key, index or caption as the parameter.
  • Item ( Variant Index ) Item
    Returns the specified Item. This is the default method for the Items object and accepts a key, index or caption as the parameter.
  • Remove ( Variant Index ) Boolean
    Removes the specified Item. Returns True if the Item was successfully removed.

Item Properties

  • Bold Boolean
    Gets / Sets whether the caption should be shown in Bold.
  • Caption String (Default Member)
    Gets / Sets the Item Caption.
  • ChildHWnd ( ) Long
    Sets a child window control to display within the item. Simply pass <control>.hWnd to this property and the control will be displayed within the item. Setting this to 0 will restore the contained control to its original parent. See the example application for more detail.
  • Enabled Boolean
    Whether the item is enabled.
  • ForeColor OLE_COLOR
    Gets / Sets the fore color for the item (if none is specified the control ItemForeColor will be used).
  • Key String
    Gets / Sets the collection Key for the Item. If no key is specified, a default key will be assigned.
  • Icon Variant
    The imagelist key to use for the large icon.
  • Index Long
    Gets / Sets the collection Index for the Item. The Index property dictates the order in which objects are drawn, allowing re-ordering at runtime.
  • MaskColor OLE_COLOR
    Gets / Sets the color to make transparent on the items image (if none is specified the control DefaultMaskColor will be used).
  • Parent Header
    Gets the header that the item is in.
  • Selected Boolean
    Whether the item is curretly selected.
  • SmallIcon Variant
    The imagelist key to use for the small icon.
  • Tag Variant
    Gets / Sets any variant you need to for each item.
  • ToolTipText String
    The tooltip for the item.
  • URLIcon String
    Gets / Sets the URL locating the large image for the item
  • URLSmallIcon String
    Gets / Sets the URL locating the small image for the item.
  • Visible Boolean
    Gets / Sets whether the Item is visible.

Item Methods

  • EnsureVisible
    Scrolls the current view so that the item is visible to the user.
  • OLEDrag
    Manually starts an OLE drag and drop operation for the Item.
  • StartLabelEdit
    Allows the user to rename the Item. If the user hits escape, no further action is taken, but if they rename the Item and hit enter, the ItemRenamed event is triggered.


Migration from Version 1.x

This section lists the major changes in the Button Bar with version 2.x

  • The programming interface has been tidied to make it more consistant with standard Visual Basic controls. An example of this change is the renaming of TextColor properties to the more standard ForeColor. Another example is the renaming of the Tab object to Header.
  • The interface is now object oriented - Version 1.x had properties and methods on the main control that altered the appearence of objects (e.g. CurrentItemCaption, CurrentTabEnabled, etc.) as well as the object oriented style (e.g. Tabs(1).Items(4).Caption ).
    Version 2.x removes the CurrentTab* and CurrentItem* properties as well as moving methods such as OLEDrag down to the appropriate object.
    As part of the OO redesign, events and properties now use objects rather than Integer indices - for example the Click event in version 1.x passed an Integer Tab number and an Integer Item number - in version 2.x, this event is replaced by two events - HeaderClick and ItemClick - which both pass the an object.
  • The control now has a Style property which gives a consistant way of setting the GUI across the whole control. In version 1.x, the View property allowed one Tab to have the Outlook style and another the Office 2000 style. This inconsistancy (which was of no use to developers or users) has now been removed.
  • Errors are now raised from the control when appropriate. The error number that the control will raise is defined in the bbError enumerated type, values listed below:
    bbErrorNotFullVersionWhileAdding - raised when attempting to add more than 6 items to the unregistered version.
    bbErrorNotFullVersionRestrictedStyle - raised when attempting to set a style other than Outlook in the unregistered version.
    bbErrorXMLParserNotPresent - raised when an XML operation cannot create the Microsoft XML parser (either version 2 or 3).
    bbErrorXMLInvalidContent - raised when an XML operation is passed an invalid XML document.

General notes

  • Image Types and Locations
    The control can display bitmaps, icons, metafiles, JPEGs, and GIF files. The URL properties can accept file locations such as C:\Windows\SetUp.bmp or URLs to files on a web server such as http://localhost/images/example.bmp

  • Keyboard Navigation
    You can let users navigate around the control with the keyboard by setting the TabStop property to True in the design environment. Once the control has focus, the navigation keys are;
      Up / Down arrows to choose items (return to select)
      Page Up / Page Down to scroll items within a Header
      Home / End to move to the top / bottom items in a Header
      Control + Page Up / Page Down to choose Headers
      Control + Home / End to move to the top / bottom Headers.