Exontrol.ExToolBar - Information, Features

ExToolBar

The eXToolBar component arranges / groups as rows or columns, any kind of graphical control elements such as buttons, icons, drop downs, editors, and so on, to let user choose quickly, what function / procedure to run. The eXToolBar component is written from scratch, uses EBN technology to let the user changes its visual appearance using skins, and requires no dependencies to any other third party library.

Features include:

  • Skinnable Interface support
  • Check box / Radio button support
  • Single/Multiple Lines HTML support
  • Ability to arrange / group the items horizontally or/and vertically
  • Ability to use any ActiveX control inside sub menus
  • Keyboard and Mouse Wheel support
  • Unlimited options to show any HTML text, images, colors, EBNs, patterns, frames anywhere on the item / items' background or foreground
  • Pictures / Images / Icons support
  • Ability to assign BUTTON, DROP-DOWN BUTTON, EDIT, MASK, COLOR, FONT, SPIN, SLIDER, SCROLLBAR, PROGRESS, ... fields to any item
  • Ability to display items as sub-menu or grouped inside the item
  • Multi-lines HTML Tooltip support for any item
  • Incremental Search/Filter the items on a submenu as you type
  • Partially Translucent support
  • Fade, light-up/down animation effects

® ExToolBar is a trademark of Exontrol. All Rights Reserved.


Exontrol - Support

How to get support?

To keep your business applications running, you need support you can count on.

Here are few hints what to do when you're stuck on your programming:

  • Check out the samples - they are here to provide some quick info on how things should be done
  • Check out the how-to questions using the eXHelper tool
  • Check out the help - includes documentation for each method, property or event
  • Check out if you have the latest version, and if you don't have it send an update request here.
  • Submit your problem(question) here.

Don't forget that you can contact our development team if you have ideas or requests for new components, by sending us an e-mail at support@exontrol.com ( please include the name of the product in the subject, ex: exgrid ) . We're sure our team of developers will try to find a way to make you happy - and us too, since we helped.

Regards,
Exontrol Development Team

https://www.exontrol.com


constants AlignmentEnum
Specifies the object's Alignment. The Alignment property specifies the item's alignment. The Caption property supports built-in HTML format, so you can use the <c> to centers the item's caption or <r> to align to the right the item's caption. The AlignmentEnum expression supports the following values:

Name | Value | Description
exLeft | 0 | Left
exCenter | 1 | Center
exRight | 2 | Right


constants AllowEditEnum
The AllowEditEnum type specifies the type of editors that can be associated with the item. The AllowEdit property associates an editor to the current item. The EditCaption property specifies the value to show in the edit field. The EditWidth property specifies the size/width of the edit field inside the item. The EditBorder property specifies whether the edit shows a border around it. The EditOption property specifies different options to be used for a specified edit field. The control fires the EditChange event when the user changes the edit's caption. Use the ShowLocalPopup property to provide a drop down list. The ShowAsButton property specifies the whether the current item displays a button or a select button ( drop down ).

Currently, the supported editors are:

Name | Value | Description
exItemDisableEdit | 0 | No editor is assigned to the current item.
exItemEditText 1 A text-box editor is assigned to the current item. The exItemEditText can be combined with the exItemEditReadOnly or exItemEditSpin flags.

exItemEditMask 2 A masked text-box editor is assigned to the current item. The EditMask property specifies the mask of the edit field. The EditValue property specifies the value of the edit field, without the masking characters. The EditOption(exEditMaskFloat) specifies whether the edit field mask a floating/decimal/integer point number. The exItemEditMask can be combined with the exItemEditReadOnly or exItemEditSpin flags.

exItemEditSlider 3 A slider editor is assigned to the current item. The exItemEditSlider can be combined with the exItemEditReadOnly, exItemEditVertical or exItemEditSpin flags. The EditValue property indicates the current slider position/value.
  • The EditOption(exEditMinValue) / EditOption(exEditMaxValue) specifies the limits values of the slider editor.
  • The EditOption(exEditTickStyle) property specifies the way the ticks are shown on the slider.
  • The EditOption(exEditTickFrequency) property specifies the frequency to show the ticks on the slider control.
  • The EditOption(exEditTickLabel) property specifies labels to be shown on the slider's ticks.
  • The EditOption(exEditSmallChange) property specifies the amount by which the edit's position changes when the user presses an arrow key.
  • The EditOption(exEditLargeChange) property specifies the amount by which the edit's position changes when the user presses an CTRL + arrow key.
  • The EditOption(exEditChangeToolTip) property specifies the specifies the expression that determines the HTML tooltip to be shown when the item's value is changed.

If exItemEditSlider flag is combined with the exItemEditVertical you can get:
exItemEditProgress 4 A progress editor is assigned to the current item. The exItemEditProgress can be combined with the exItemEditReadOnly, exItemEditVertical or exItemEditSpin flags. The EditValue property indicates the current progress position/value.

If exItemEditProgress flag is combined with the exItemEditVertical you can get:
exItemEditScrollBar 5 A scrollbar editor is assigned to the current item. The exItemEditScrollBar can be combined with the exItemEditReadOnly, exItemEditVertical or exItemEditSpin flags. The EditValue property indicates the current scroll position/value.

If exItemEditScrollBar flag is combined with the exItemEditVertical you can get:

  • The EditOption(exEditMinValue) / EditOption(exEditMaxValue) specifies the limits values of the scroll editor.
  • The EditOption(exEditSmallChange) property specifies the amount by which the edit's position changes when the user presses an arrow key.
  • The EditOption(exEditLargeChange) property specifies the amount by which the edit's position changes when the user presses an CTRL + arrow key.
  • The EditOption(exEditChangeToolTip) property specifies the specifies the expression that determines the HTML tooltip to be shown when the item's value is changed.

exItemEditColor 6 A color editor is assigned to the current item. The exItemEditColor can be combined with the exItemEditReadOnly or exItemEditSpin flags. The EditValue property indicates the current color value.

exItemEditFont 7 A font editor is assigned to the current item. The exItemEditFont can be combined with the exItemEditReadOnly or exItemEditSpin flags. The EditCaption property indicates the current font name.

exItemEditReadOnly | 256 | Disables the current's item editor. This flag can be combined with any other option.
exItemEditSpin 512 A spin editor is assigned to the current item. This flag can be combined with any other option. The following picture combines a exItemEditSlider with the exItemEditSpin

  • The EditOption(exEditSpinStep) specifies the step to advance when user clicks the editor's spin.
exItemEditVertical | 1024 | The editor is vertically oriented. You can combine this flag with exItemEditSlider, exItemEditProgress and exItemEditScrollBar


constants ArrangeItemsEnum
The ArrangeItemsEnum type specifies the way the items are arranged on the toolbar. The ArrangeItemsAs property specifies how the items are arranged on the toolbar. The ArrangeItemsEnum type supports the following flags:

Name | Value | Description
exArrangeItemsDefault | 0 | Arranges items from top to bottom. This flag can not be combined with none of the following flags.
exArrangeItemsHorizontal | 1 | Arranges items from left to right. The items are arranged on a single row, unless it is not combined with exArrangeItemsWrap flag.
exArrangeItemsVertical | 2 | Arranges items from top to bottom. The items are arranged on a single row, unless it is not combined with exArrangeItemsWrap flag.
exArrangeItemsWrap | 256 | Wraps items on a new row/column. This flag can be combined with exArrangeItemsHorizontal / exArrangeItemsVertical, and if so, the toolbar may display items on multiple rows.
exArrangeItemsScroll | 512 | Scrolls the view when the cursor hovers it.
exArrangeItemsAlignCenter | 1024 | Centers the items on each row/column.
exArrangeItemsAlignReverse | 2048 | Right / Bottom aligns the items on each row/column.


constants BackgroundPartEnum
The BackgroundPartEnum type indicates parts in the control. Use the Background property to specify a background color or a visual appearance for specific parts in the control. A Color expression that indicates the background color for a specified part. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.

Name | Value | Description
exToolTipAppearance | 64 | Specifies the visual appearance of the borders of the tooltips.
exToolTipBackColor | 65 | Specifies the tooltip's background color.
exToolTipForeColor | 66 | Specifies the tooltip's foreground color.
exCheckBoxState0 | 70 | Specifies the visual appearance for the check box in 0 state (unchecked).
exCheckBoxState1 | 71 | Specifies the visual appearance for the check box in 1 state (checked).
exCheckBoxState2 | 72 | Specifies the visual appearance for the check box in 2 state (partial, not used).
exRadioButtonState0 | 73 | Specifies the visual appearance for the radio button in 0 state (unchecked).
exRadioButtonState1 | 74 | Specifies the visual appearance for the radio button in 1 state (checked).
exMenuFlatLineColor | 100 | Specifies the color to show the vertical line on flat appearance.
exMenuScrollBackColor | 101 | Specifies the background color to show the menu's scroll bars.
exMenuSelBorderColor | 102 | Specifies the color to show the frame arround the selected item.
exMenuSeparatorItem | 103 | Specifies the color to show the separator item.
exMenuButtonItem | 104 | Specifies the visual appearance for an item, when the Appearance property is Button.
exGroupPopupFrameSingle | 105 | Specifies the visual appearance/solid color of the frame around the grouping items, when its group includes a single item. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameSingle, exGroupPopupFrameHStart, exGroupPopupFrameHIntermediate and exGroupPopupFrameHEnd to specify a different visual appearance for the frame around grouping items (horizontally). The following screen shot shows the grouping items with an EBN frame: which has been created using the following 4 EBNs (exGroupPopupFrameSingle, exGroupPopupFrameHStart, exGroupPopupFrameHIntermediate, exGroupPopupFrameHEnd ):
exGroupPopupFrameHStart | 106 | Specifies the visual appearance/solid color of the frame around the first item ( horizontally arranged ), when the its group includes more items. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameSingle, exGroupPopupFrameHStart, exGroupPopupFrameHIntermediate and exGroupPopupFrameHEnd to specify a different visual appearance for the frame around grouping items (horizontally).
exGroupPopupFrameHIntermediate | 107 | Specifies the visual appearance/solid color of the frame around an intermediate item ( not start or end item, horizontally arranged ), when the its group includes more items. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameSingle, exGroupPopupFrameHStart, exGroupPopupFrameHIntermediate and exGroupPopupFrameHEnd to specify a different visual appearance for the frame around grouping items (horizontally).
exGroupPopupFrameHEnd | 108 | Specifies the visual appearance/solid color of the frame around the last item ( not start or intermediate item, horizontally arranged ), when the its group includes more items. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameSingle, exGroupPopupFrameHStart, exGroupPopupFrameHIntermediate and exGroupPopupFrameHEnd to specify a different visual appearance for the frame around grouping items (horizontally).
exGroupPopupFrameSolid | 109 | Specifies the solid color of the frame around the grouping items.
exMenuHotBackColor | 110 | Specifies the visual appearance/color to show the item from the cursor.
exMenuHotForeColor | 111 | Specifies the foreground color to show the item from the cursor.
exMenuSelHotBackColor | 112 | Specifies the visual appearance/color to show the selected item from the cursor.
exMenuSelHotForeColor | 113 | Specifies the foreground color to show the selected item from the cursor.
exMenuSeparatorSelectButton | 114 | Specifies the visual appearance/color to show the separator between select and drop down button.
exMenuSeparatorSelectButtonBottom | 115 | Specifies the visual appearance/color to show the separator between select and drop down button ( show the drop-down button to the bottom ).
exGroupPopupFrameVStart | 116 | Specifies the visual appearance/solid color of the frame around the first item ( vertically arranged ), when the its group includes more items. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameVStart, exGroupPopupFrameVIntermediate and exGroupPopupFrameVEnd to specify a different visual appearance for the frame around grouping items (vertically). The following screen shot shows the grouping items with an EBN frame: which has been created using the following 4 EBNs ( exGroupPopupFrameSingle, exGroupPopupFrameVStart, exGroupPopupFrameVIntermediate, exGroupPopupFrameVEnd):
exGroupPopupFrameVIntermediate | 117 | Specifies the visual appearance/solid color of the frame around an intermediate item ( not start or end item, vertically arranged ), when the its group includes more items. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameVStart, exGroupPopupFrameVIntermediate and exGroupPopupFrameVEnd to specify a different visual appearance for the frame around grouping items (vertically).
exGroupPopupFrameVEnd | 118 | Specifies the visual appearance/solid color of the frame around the last item ( not intermediate or end item, vertically arranged ), when the its group includes more items. The GroupPopup property specifies the way the item's submenu are grouped. Use the exGroupPopupFrameVStart, exGroupPopupFrameVIntermediate and exGroupPopupFrameVEnd to specify a different visual appearance for the frame around grouping items (vertically).
exScrollViewBorder | 119 | Specifies the visual appearance of the control's border that cuts the scrolling portion of the control.
exMenuHotBorderColor | 139 | Specifies the color to show the frame around around the item from the cursor.
exMenuSelHotBorderColor | 140 | Specifies the color to show the frame around around the selected item from the cursor.
exShortcutKeyAppearance | 143 | Specifies the visual appearance of the shortcut keys.
exShortcutKeyBackColor | 144 | Specifies the shortcut keys background color.
exShortcutKeyForeColor | 145 | Specifies the shortcut keys foreground color.


constants CloseOnClickEnum
The CloseOnClickEnum type specifies when the user can close the popup menu. The CloseOnClick property specifies how the popup menu is closed when user clicks an item. The CloseOnClickEnum type supports the following values:

Name | Value | Description
exCloseOnClick | 0 | The popup menu is closing when the user clicks an item.
exCloseOnDblClick | 1 | The popup menu is closing when the user double clicks an item.
exCloseOnClickOutside | 2 | The popup menu is closing when the user clicks outside of the menu.
exCloseOnNonClickable 3 The popup menu is closing when the user clicks a non-clickable item ( regular items ).

Here's the list of clickable items:

  • separator items
  • item that hosts a sub-menu ( popup item )
  • disabled item
  • check or radio items

For instance, clicking a check-box item will makes the check box to change its state instead closing the popup menu.


constants CloseOnEnum
The CloseOnEnum type specifies how an item that contains an ActiveX inside is close. The CloseOn property indicates how the user closes the popup menu when an inside ActiveX control is clicked. The CloseOnEnum type supports the following values:

Name | Value | Description
exUser | 0 | The user is responsible for closing the popup menu.
exLButtonDown | 513 | The popup menu is closed when user presses the left mouse button over the ActiveX control.
exLButtonUp | 514 | The popup menu is closed when user releases the left mouse button over the ActiveX control.
exLButtonDblClk | 515 | The popup menu is closed when user double click the ActiveX control.
exRButtonDown | 516 | The popup menu is closed when user right clicks the ActiveX control.
exRButtonUp | 517 | The popup menu is closed when user releases the right mouse button over the ActiveX control.
exRButtonDblClk | 518 | The popup menu is closed when user double click the right mouse button in the ActiveX control.
exMButtonDown | 519 | The popup menu is closed when user clicks the middle mouse button in the ActiveX control.
exMButtonUp | 520 | The popup menu is closed when user releases the middle mouse button in the ActiveX control.
exMButtonDblClk | 521 | The popup menu is closed when user double clicks the middle mouse button in the ActiveX control.
exClick | 61441 | The popup menu is closed when user presses any of the mouse buttons in the ActiveX control.
exDblClick | 61442 | The popup menu is closed when user double clicks any of the mouse buttons in the ActiveX control.


constants EditBorderEnum
Specifies the type of the border around the edit control inside the item. Use the AllowEdit property to assign a single edit control to an item. Use the EditBorder property to specify the type of the border for the edit control inside the item.

Name | Value | Description
exEditBorderNone | 0 | No border.
exEditBorderInset | -1 | Inset border.
exEditBorderSingle | 1 | Single border.


constants EditOptionEnum
The EditOptionEnum type specifies different options to be set / get for giving editor. The EditOption property specifies different options to be used for a specified edit field. The AllowEdit property associates an editor to the current item. The EditCaption property specifies the value to show in the edit field. The EditWidth property specifies the size/width of the edit field inside the item. The EditBorder property specifies whether the edit shows a border around it. The control fires the EditChange event when the user changes the edit's caption.

The control supports the following options:

Name | Value | Description
exEditMinValue 1 Specifies the minimum value for the item's edit field. By default, the exEditMinValue option is 0. This option is valid for editors like: exItemEditSlider, exItemEditScrollBar

(long expression)
exEditMaxValue 2 Specifies the maximum value for the item's edit field. By default, the exEditMinValue option is 100. This option is valid for editors like: exItemEditSlider, exItemEditScrollBar

(long expression)
exEditTickStyle 3 Specifies where the ticks appears on the edit field. By default, the exEditTickStyle option is 1. The value of this option could be one of the following:
  • 0 ( exBottomRight ), The ticks are displayed on the bottom/right side
  • 1 ( exTopLeft ), The ticks are displayed on the top/left side
  • 2 ( exBoth ), The ticks are displayed on the both side
  • 3 ( exNoTicks ), No ticks are displayed

This option is valid for editors like: exItemEditSlider

(long expression)
exEditTickFrequency | 4 | Indicates the ratio of ticks on the control. By default, the exEditTickFrequency option is 10. This option is valid for editors like: exItemEditSlider (long expression)
exEditTickLabel 5 Specifies the expression that determines the HTML labels to be shown on ticks.

For instance:

  • "value", shows the values for each tick.
  • " (value=current ? '<font ;12><fgcolor=FF0000>' : '' ) + value", shows the current slider's position with a different color and font.
  • "value = current ? value : ''", shows the value for the current tick only.
  • "( value = current ? '<b><font ;10>' : '' ) + (value array 'ab bc cd de ef fg gh hi ij jk kl' split ' ')" displays different captions for slider's values.

The option supports the following keywords:

  • value gets the slider's position to be displayed
  • current gets the current slider's value.
  • vmin gets the slider's minimum value.
  • vmax gets the slider's maximum value.
  • smin gets the slider's selection minimum value.
  • smax gets the slider's selection maximum value.

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for is

"expression ? true_part : false_part"

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

"expression array (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')".

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

"expression in (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

"expression switch (default,c1,c2,c3,...,cn)"

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:

    • #4/1/2009#, from hours 06:00 AM to 12:00 PM
    • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
    • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.

Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%0) = 8 specifies the cells that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string
  • dbl (unary operator) converts the expression to a number
  • date (unary operator) converts the expression to a date, based on your regional settings
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS.

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string
  • lower (unary operator) returns a string expression in lowercase letters
  • upper (unary operator) returns a string expression in uppercase letters
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names
  • ltrim (unary operator) removes spaces on the left side of a string
  • rtrim (unary operator) removes spaces on the right side of a string
  • trim (unary operator) removes spaces on both sides of a string
  • startwith (binary operator) specifies whether a string starts with specified string
  • endwith (binary operator) specifies whether a string ends with specified string
  • contains (binary operator) specifies whether a string contains another specified string
  • left (binary operator) retrieves the left part of the string
  • right (binary operator) retrieves the right part of the string
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on )
  • a count b (binary operator) retrieves the number of occurrences of the b in a
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result.
  • a split b, splits the a using the separator b, and returns an array. For instance, the "weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' '" gets the weekday as string. This operator can be used with the array

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel.
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance the timeF(1:23 PM) returns "13:23:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel.
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance the shortdateF(December 31, 1971 11:00 AM) returns "12/31/1971".
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format.
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel.
  • year (unary operator) retrieves the year of the date (100,...,9999)
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 )
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 )
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 )
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday )
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 )
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 )
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 )

The The <VALUE> of [ticklabel] option can display labels using the following built-in HTML tags:

  • <b>…</b> displays the text in bold.
  • <i>…</i> displays the text in italics.
  • <u>…</u> underlines the text.
  • <s>…</s> Strike-through text
  • <font face;size>…</font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor=RRGGBB>…</fgcolor> displays text with a specified foreground color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <bgcolor=RRGGBB>…</bgcolor> displays text with a specified background color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <br> a forced line-break
  • <solidline> The next line shows a solid-line on top/bottom side. If has no effect for a single line caption.
  • <dotline> The next line shows a dot-line on top/bottom side. If has no effect for a single line caption.
  • <upline> The next line shows a solid/dot-line on top side. If has no effect for a single line caption.
  • <r> Right aligns the text
  • <c> Centers the text
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number ( the character with specified code ), For instance, the &#8364 displays the EUR character, in UNICODE configuration. The & ampersand is only recognized as markup when it is followed by a known letter or a # character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;

(string expression)
exEditSmallChange 6 The amount by which the edit's position changes when the user presses an arrow key. By default, the exEditSmallChange option is 1. This option is valid for editors like: exItemEditSlider, exItemEditScrollBar

(long expression)
exEditLargeChange 7 The amount by which the edit's position changes when the user presses an CTRL + arrow key. By default, the exEditLargeChange option is 5. This option is valid for editors like: exItemEditSlider, exItemEditScrollBar

(long expression)
exEditChangeToolTip 8 Specifies the expression that determines the HTML tooltip to be shown when the item's value is changed. By default, the exEditChangeToolTip option is "value". This option is valid for editors like: exItemEditSlider, exItemEditScrollBar

The option supports the following keywords:

  • value gets the slider's position to be displayed

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for is

"expression ? true_part : false_part"

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

"expression array (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')".

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

"expression in (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

"expression switch (default,c1,c2,c3,...,cn)"

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:

    • #4/1/2009#, from hours 06:00 AM to 12:00 PM
    • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
    • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.

Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%0) = 8 specifies the cells that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string
  • dbl (unary operator) converts the expression to a number
  • date (unary operator) converts the expression to a date, based on your regional settings
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS.

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string
  • lower (unary operator) returns a string expression in lowercase letters
  • upper (unary operator) returns a string expression in uppercase letters
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names
  • ltrim (unary operator) removes spaces on the left side of a string
  • rtrim (unary operator) removes spaces on the right side of a string
  • trim (unary operator) removes spaces on both sides of a string
  • startwith (binary operator) specifies whether a string starts with specified string
  • endwith (binary operator) specifies whether a string ends with specified string
  • contains (binary operator) specifies whether a string contains another specified string
  • left (binary operator) retrieves the left part of the string
  • right (binary operator) retrieves the right part of the string
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on )
  • a count b (binary operator) retrieves the number of occurrences of the b in a
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result.
  • a split b, splits the a using the separator b, and returns an array. For instance, the "weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' '" gets the weekday as string. This operator can be used with the array

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel.
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance the timeF(1:23 PM) returns "13:23:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel.
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance the shortdateF(December 31, 1971 11:00 AM) returns "12/31/1971".
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format.
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel.
  • year (unary operator) retrieves the year of the date (100,...,9999)
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 )
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 )
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 )
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday )
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 )
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 )
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 )

The The <VALUE> of [ticklabel] option can display labels using the following built-in HTML tags:

  • <b>…</b> displays the text in bold.
  • <i>…</i> displays the text in italics.
  • <u>…</u> underlines the text.
  • <s>…</s> Strike-through text
  • <font face;size>…</font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor=RRGGBB>…</fgcolor> displays text with a specified foreground color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <bgcolor=RRGGBB>…</bgcolor> displays text with a specified background color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <br> a forced line-break
  • <solidline> The next line shows a solid-line on top/bottom side. If has no effect for a single line caption.
  • <dotline> The next line shows a dot-line on top/bottom side. If has no effect for a single line caption.
  • <upline> The next line shows a solid/dot-line on top side. If has no effect for a single line caption.
  • <r> Right aligns the text
  • <c> Centers the text
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number ( the character with specified code ), For instance, the &#8364 displays the EUR character, in UNICODE configuration. The & ampersand is only recognized as markup when it is followed by a known letter or a # character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;

(string expression)
exEditMaskFloat 9 Specifies whether the mask field masks a floating point number. By default, the exEditMaskFloat is False. This flag is valid only for editors of exItemEditMask type.

( boolean expression )
exEditSpinStep 10 Specifies the step to advance when user clicks the editor's spin. By default, the exEditSpinStep is 1. This flag is valid only for editors of exItemEditSpin type.

( long expression )


constants GroupPopupEnum
The GroupPopupEnum type specifies whether the sub-menu of the current item is shown as grouped. The GroupPopup property specifies whether the sub-menu of the current item is shown as grouped. The GroupPopupEnum type supports the following values:

Name | Value | Description
exNoGroupPopup | 0 | No grouping is performed on the popup item.
exGroupPopup | 1 | Groups and displays the sub-menu items on the current item, arranged from left to right ( by default, the items are horizontally arranged ).
exNoGroupPopupFrame | 2 | Prevents showing the frame around each grouping item. If the exNoGroupPopupFrame flag is not present, the control shows a frame around the grouping items. The frame around grouping items can be a solid box or EBN frames. The Background(exGroupPopupFrameSolid) specifies the color to show the frames around grouping items, while the The Background(exGroupPopupFrameSingle), Background(exGroupPopupFrameHStart), Background(exGroupPopupFrameHIntermediate), Background(exGroupPopupFrameHEnd) specifies the EBN to be shown for single element, starting element/item of the group, intermediate elements, and ending element/item. The exGroupPopupFrameHStart, exGroupPopupFrameHIntermediate and exGroupPopupFrameHEnd are valid for horizontally grouping items ( exGroupPopupVertical flag is not present ).
exGroupPopupCenter | 4 | Shows the grouping popup aligned to the center of the current item.
exGroupPopupRight | 8 | Shows the grouping popup aligned to the right of the current item.
exGroupPopupEqualWidth | 16 | Shows the items that make the group of the same width.
exGroupPopupEqualHeight | 32 | Shows the items that make the group of the same height.
exGroupPopupFrameSolidBox | 64 | Forces the grouping items to show the solid frame (exGroupPopupFrameSolid) rather than EBN frame. The exGroupPopupFrameSolidBox flag can be combined with the exGroupPopupFrameThickBox to specify a ticker solid frame. This flag has no effect if the exNoGroupPopupFrame is present.
exGroupPopupFrameThickBox | 128 | Specifies that the grouping items shows a ticker frame. The exGroupPopupFrameThickBox flag can be combined with the exGroupPopupFrameSolidBox to specify a ticker solid frame. This flag has no effect if the exNoGroupPopupFrame is present.
exGroupPopupVertical | 256 | Arranges vertically the items that compose the group ( by default, the items are horizontally arranged ). If the exNoGroupPopupFrame flag is not present, the control shows a frame around the grouping items. The frame around grouping items can be a solid box or EBN frames. The Background(exGroupPopupFrameSolid) specifies the color to show the frames around grouping items, while the The Background(exGroupPopupFrameSingle), Background(exGroupPopupFrameVStart), Background(exGroupPopupFrameVIntermediate), Background(exGroupPopupFrameVEnd) specifies the EBN to be shown for single element, starting element/item of the group, intermediate elements, and ending element/item. The exGroupPopupFrameVStart, exGroupPopupFrameVIntermediate and exGroupPopupFrameVEnd are valid for vertically grouping items ( exGroupPopupVertical flag is present ).


constants MenuItemTypeEnum
The MenuItemTypeEnum type specifies the type of Item objects to be collected using the Get method. The Get method can be used to get a collection / safe array of Item objects with a specified characteristics. For instance, you can collect the items of Edit type, or items that holds an Edit field inside. The MenuItemTypeEnum type supports the following values:

Name | Value | Description
exRegularMenuItem | 0 | Indicates a regular item. A regular item contains no sub-menus, no sub-control, no check box, no radio buttons and it is not a separator item.
exCheckBoxMenuItem | 1 | Indicates an item with a check box. The Check property specifies whether the item displays a check box.
exRadioButtonMenuItem | 2 | Indicates an item with a radio button. The Radio property specifies whether the item displays a radio button.
exSubMenuItem | 3 | Indicates a sub-menu item or an item that displays another menu.
exSeparatorMenuItem | 4 | Specifies a separator item. The SubMenu property gives access to the items collection being shown in the popup menu.
exControlMenuItem | 5 | Indicates a sub-menu item that displays an ActiveX or a Window inside. The SubControl property gives access to the Control object being displayed.
exAllMenuItems | 15 | Indicates any type of item
exImageMenuItem | 16 | This flag can be combined with any other flag and value to specify the items that display icons using the Image property.
exDisplayTFIMenuItem | 32 | Reserved.
exEditMenuItem | 64 | This flag can be combined with any other flag and value to specify the items that display any Edit field inside. The EditCaption property specifies the caption to be shown in the item's edit field.
exDisabledMenuItem | 128 | This flag can be combined with any other flag and value to specify the disabled items, or items with the Enabled property on False.
exUncheckedMenuItem | 256 | This flag can be combined with any other flag and value to specify un-checked items, or items with the Checked property on False.
exCheckedMenuItem | 512 | This flag can be combined with any other flag and value to specify checked items, or items with the Checked property on True.
exPartialCheckedMenuItem | 768 | Reserved.


constants ModifierKeyEnum
The ModifierKeyEnum type specifies the modifies keys. The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible. The ModifierKeyEnum type supports the following values:

Name | Value | Description
exNoModifier | 0 | (HEXA: 0x00000000) No modifier key.
exModifierShift | 65536 | (HEXA: 0x00010000) Indicates the SHIFT modifier key.
exModifierCtrl | 131072 | (HEXA: 0x00020000) Indicates the CTRL modifier key.
exModifierAlt | 262144 | (HEXA: 0x00040000) Indicates the ALT modifier key.
exModifierAny | -65536 | (HEXA: 0xFFFF0000) Indicates any modifier key.


constants IncrementalSearchEnum
"In computing, incremental search, incremental find or real-time suggestions is a user interface interaction method to progressively search for and filter through text. As the user types text, one or more possible matches for the text are found and immediately presented to the user. ". The IncrementalSearchEnum type specifies how the control performs the incremental searching while user types characters. The PopupIncrementalSearch property the control's incremental search type.

Name | Value | Description
exNoIncrementalSearch | 0 | No incremental search is performed, when the user types characters.
exISearchStartWith | 1 | Specifies that the control looks for objects that starts with typed characters, with highlighting the found result.
exISearchContains | 2 | Specifies that the control looks for objects that contains typed characters, with highlighting the found result.
exISearchFilterFor | 16 | The control displays just the items that match the typed characters.


constants PictureDisplayEnum
Specifies how a picture object is displayed.

Name | Value | Description
UpperLeft | 0 | Aligns the picture to the upper left corner.
UpperCenter | 1 | Centers the picture on the upper edge.
UpperRight | 2 | Aligns the picture to the upper right corner.
MiddleLeft | 16 | Aligns horizontally the picture on the left side, and centers the picture vertically.
MiddleCenter | 17 | Puts the picture on the center of the source.
MiddleRight | 18 | Aligns horizontally the picture on the right side, and centers the picture vertically.
LowerLeft | 32 | Aligns the picture to the lower left corner.
LowerCenter | 33 | Centers the picture on the lower edge.
LowerRight | 34 | Aligns the picture to the lower right corner.
Tile | 48 | Tiles the picture on the source.
Stretch | 49 | The picture is resized to fit the source.


constants ShortcutKeyAlignEnum
The ShortcutKeyAlignEnum type defines different type of alignments. The ShortcutKeyAlignH / ShortcutKeyAlignV property defines the alignment of the UI shortcut keys relative to the item that displays it. The ShortcutKeyAlignEnum type supports the following values:

Name | Value | Description
exShortcutKeyUpperLeft | 0 | Aligns the shortcut keys relative to upper-left point of the item.
exShortcutKeyUpperCenter | 1 | Aligns the shortcut keys relative to upper-point point of the item.
exShortcutKeyUpperRight | 2 | Aligns the shortcut keys relative to upper-right point of the item.
exShortcutKeyMiddleLeft | 16 | Aligns the shortcut keys relative to middle-left point of the item.
exShortcutKeyMiddleCenter | 17 | Aligns the shortcut keys relative to middle-center point of the item.
exShortcutKeyMiddleRight | 18 | Aligns the shortcut keys relative to middle-right point of the item.
exShortcutKeyLowerLeft | 32 | Aligns the shortcut keys relative to lower-left point of the item.
exShortcutKeyLowerCenter | 33 | Aligns the shortcut keys relative to lower-center point of the item.
exShortcutKeyLowerRight | 34 | Aligns the shortcut keys relative to lower-right point of the item.


constants ShortcutKeyVisibleEnum
The ShortcutKeyVisibleEnum type defines whether the shortcut key is visible or hidden. The ShortcutKeyVisible property gets or sets a value that specifies whether the control's shortcut keys are visible or hidden. The ShortcutKeyVisibleEnum type supports the following flags:

Name | Value | Description
exHideShortcutKeys | 0 | No visual appearance is shown for any of the shortcut keys.
exShowShortcutKeysPressOnly | 1 | The visual appearance of each available shortcut key is shown as soon as the user presses the modifier keys.
exShowShortcutKeysPressOnlyDelayed | 2 | The visual appearance of each available shortcut key is shown delayed as soon as the user presses the modifier keys.
exShowShortcutKeysToggle | 3 | The visual appearance of each available shortcut key is shown or hidden when the user releases the modifier keys.
exShowShortcutKeysToggleDelayed | 4 | The visual appearance of each available shortcut key is shown or hidden when the user releases the modifier keys, or as soon as the user keeps pressing the modifier keys.
exDisableShortcutKeys | 16 | All shortcut keys are disabled. This flag can be combined with any other.
exDisplayShortcutKeysAllAvailable | 32 | All available shortcut keys are shown. This flag can be combined with any other.
exLongerDelayShortcutKeys | 64 | Specifies a longer delay for Delayed modes. This flag can be combined with any other.
exAllowShortcutKeysIfNotShown | 128 | Indicates that the user can invoke any shortcut, even if it is not visible. This flag can be combined with any other.
exCloseShortcutKeysOnClick | 256 | Specifies to close the shortcut keys when the user click anywhere. This flag can be combined with any other.


constants ShowAsButtonEnum
The ShowAsButtonEnum type specifies the way a button is shown. The ShowAsButton property specifies whether the current item is shown a button or a select button. The ShowAsButtonEnum type supports the following values:

Name | Value | Description
exShowAsButtonNone | 0 | No button is associated with the current item.
exShowAsButton | 1 | A button is associated with the current item. This flag can be combined with exShowAsButtonAutoSize flag.
exShowAsButtonAutoSize | 2 | The size of the button's caption fits the item's caption. This flag can be combined with any other flags.
exShowAsSelectButton | 17 | A select button is associated with the current item ( show the drop-down button to the right ). The exShowAsSelectButton flag has effect only if the current item is a popup item, so it contains sub-items. The SubMenu property gives access to the item's sub menu, while it is a popup item. The Add(Caption,SubMenu) adds a popup item. The item's SubMenu is shown bellow the button, when user clicks the associated arrow. The popup being shown is a local popup, so clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.
exShowAsSelectButtonBottom | 273 | A select button is associated with the current item ( show the drop-down button to the bottom ). The exShowAsSelectButtonBottom flag has effect only if the current item is a popup item, so it contains sub-items. The SubMenu property gives access to the item's sub menu, while it is a popup item. The Add(Caption, SubMenu) adds a popup item ( an item that contains sub-items ). The item's SubMenu is shown bellow the button, when user clicks the associated arrow. The popup being shown is a local popup, so clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.
exShowAsSelectList | 512 | exShowAsSelectList. A select button is associated with the current item ( the drop down is shown when the user clicks any part of the button ).


constants ShowCheckedAsSelectedEnum
The ShowCheckedAsSelected property specifies whether the checked items (all) shows as selected. The ShowCheckedAsSelected property of the Item object specifies whether the individual checked item is shown as selected. The ShowCheckedAsSelectedEnum type supports the following values.

Name | Value | Description
exDisplayItemCheckDefault | 0 | No highlighting is applied to item.
exDisplayItemCheckHighlight | -1 | Highlights or un-highlights the checked/unchecked item, but still the check/radio buttons are shown.
exDisplayItemHighlight | 1 | Highlights or un-highlights the checked/unchecked item, but check/radio buttons are hidden.
exDisplayItemCheckInherit | 2 | Inherits the value of the control's ShowCheckedAsSelected property.


constants ShowPopupAlignEnum
The ShowPopupAlign type specifies the position to show the drop down popup menu. The ShowPopupAlign property specifies how the item's sub-menu is aligned relative to the parent item. The ShowPopupAlign type supports the following values:

Name | Value | Description
exShowPopupAlignNone | 0 | The sub-menu/popup is shown up-left aligned relative to the parent item.
exShowPopupAlignDown | 1 | The sub-menu/popup is shown down-aligned relative to the parent item.
exShowPopupAlignRight | 2 | The sub-menu/popup is shown right-aligned relative to the parent item.


constants ShowPopupArrowEnum
The ShowPopupArrowEnum type specifies how the arrow of an item that displays a sub-menu is shown. The ShowPopupArrow specifies how the arrow of an item that displays a sub-menu is shown. The ShowPopupArrowEnum supports the following values:

Name | Value | Description
exPopupArrowNone | 0 | No arrow is shown.
exShowPopupArrowLight | 1 | The item shows a light arrow when it displays a sub-menu.
exShowPopupArrowDark | 2 | The item shows a dark arrow when it displays a sub-menu.


constants ShowPopupEffectEnum
The ShowPopupEffectEnum value indicates the effect to be shown, when the user clicks an item with a sub-menu associated. The ShowPopupEffect property indicates the effect to be applied when the popup menu is shown. The ShowPopupEffectEnum type supports the following values:

Name | Value | Description
exShowPopupDirect | 0 | The popup menu is shown directly, with no effect.
exShowPopupScroll | -1 | The popup menu is scrolling before showing.
exShowPopupLightUp | 1 | The popup menu is lightning up before showing.


constants SubMenuSortOrderEnum
The SubMenuSortOrderEnum type specifies the way the submenu displays the items. The SortOrder property specifies the sort order to display the items in the sub menu. The SubMenuSortOrderEnum type supports the following values:

Name | Value | Description
exSubMenuUnsorted | 0 | No sort is applied when the submenu is displayed.
exSubMenuAscending | 1 | The items in the submenu are alphabetically displayed in ascending order.
exSubMenuDescending | 2 | The items in the submenu are alphabetically displayed in descending order.
exSubMenuReverse | 3 | The items in the submenu are displayed in reverse order.


constants ItemTypeEnum
The ItemTypeEnum type specifies the type of items to be added to the control. The ItemType parameter of the Add method specifies the type of the item to be added to the Items collection. The ItemTypeEnum type supports the following values:

Name | Value | Description
Regular | 0 | Specifies a regular item, with no sub menu.
Separator | 1 | Specifies a separator item. The Background(exMenuSeparatorItem) property specifies the visual appearance of the separator items.
SubMenu | 2 | Specifies a sub menu. The SubMenu property gets a collection of Item objects to be displayed on the sub-menu.
SubControl | 3 | Specifies a popup menu that hosts an ActiveX control or a Window. The SubControl property gets access to the Control object that holds information about the inside ActiveX or Window hosted by the item


constants ToolBarAppearanceEnum
The AppearanceEnum type specifies the visual appearance/border of the control or popup menus. The Appearance property specifies the visual appearance/border of the control. The PopupAppearance property specifies the default visual appearance/border of the popup menus. The LocalAppearance property specifies the default visual appearance/border of the drop down menu to be shown when selecting a drop down button. The ToolBarAppearanceEnum type supports the following values:

Name | Value | Description
NoBorder | 0 | NoBorder
FlatBorder | 1 | FlatBorder
SunkenBorder | 2 | SunkenBorder
RaisedBorder | 3 | RaisedBorder
EtchedBorder | 4 | EtchedBorder
BumpBorder | 5 | BumpBorder
ShadowBorder | 6 | ShadowBorder
InsetBorder | 7 | InsetBorder
SingleBorder | 8 | SingleBorder


constants UIVisualThemeEnum
The UIVisualThemeEnum expression specifies the UI parts that the control can shown using the current visual theme. The UseVisualTheme property specifies whether the UI parts of the control are displayed using the current visual theme.

Name | Value | Description
exNoVisualTheme | 0 | exNoVisualTheme
exDefaultVisualTheme | 16777215 | exDefaultVisualTheme
exHeaderVisualTheme | 1 | exHeaderVisualTheme
exFilterBarVisualTheme | 2 | exFilterBarVisualTheme
exButtonsVisualTheme | 4 | exButtonsVisualTheme
exCalendarVisualTheme | 8 | exCalendarVisualTheme
exSliderVisualTheme | 16 | exSliderVisualTheme
exSpinVisualTheme | 32 | exSpinVisualTheme
exCheckBoxVisualTheme | 64 | exCheckBoxVisualTheme
exProgressVisualTheme | 128 | exProgressVisualTheme
exCalculatorVisualTheme | 256 | exCalculatorVisualTheme


Appearance object
The component lets the user changes its visual appearance using skins, each one providing an additional visual experience that enhances viewing pleasure. Skins are relatively easy to build and put on any part of the control. The Appearance object holds a collection of skins. The Appearance object supports the following properties and methods:

Name | Description
Add | Adds or replaces a skin object to the control.
Clear | Removes all skins in the control.
Remove | Removes a specific skin from the control.
RenderType | Specifies the way colored EBN objects are displayed on the component.


method Add

method Appearance.Add (ID as Long, Skin as Variant)
Adds or replaces a skin object to the control.

Type | Description
ID as Long | A Long expression that indicates the index of the skin being added or replaced. The value must be between 1 and 126, so Appearance collection should holds no more than 126 elements.
Skin as Variant The Skin parameter of the Add method can a STRING as explained bellow, a BYTE[] / safe arrays of VT_I1 or VT_UI1 expression that indicates the content of the EBN file. You can use the BYTE[] / safe arrays of VT_I1 or VT_UI1 option when using the EBN file directly in the resources of the project. For instance, the VB6 provides the LoadResData to get the safe array o bytes for specified resource, while in VB/NET or C# the internal class Resources provides definitions for all files being inserted. ( ResourceManager.GetObject("ebn", resourceCulture) )

If the Skin parameter points to a string expression, it can be one of the following:

  • A path to the skin file ( *.EBN ). The ExButton component or ExEBN tool can be used to create, view or edit EBN files. For instance, "C:\Program Files\Exontrol\ExButton\Sample\EBN\MSOffice-ToolBar\msor_frameh.ebn"
  • A BASE64 encoded string that holds the skin file ( *.EBN ). Use the ExImages tool to build BASE 64 encoded strings of the skin file ( *.EBN ). The BASE64 encoded string starts with "gBFLBCJw..."
  • An Windows XP theme part, if the Skin parameter starts with "XP:". Use this option, to display any UI element of the Current Windows XP Theme, on any part of the control. In this case, the syntax of the Skin parameter is: "XP:ClassName Part State" where the ClassName defines the window/control class name in the Windows XP Theme, the Part indicates a long expression that defines the part, and the State indicates the state of the part to be shown. All known values for window/class, part and start are defined at the end of this document. For instance the "XP:Header 1 2" indicates the part 1 of the Header class in the state 2, in the current Windows XP theme.

The following screen shots show a few Windows XP Theme Elements, running on Windows Vista and Windows 10, using the XP options:

  • A copy of another skin with different coordinates ( position, size ), if the Skin parameter starts with "CP:". Use this option, to display the EBN, using different coordinates ( position, size ). By default, the EBN skin object is rendered on the part's client area. Using this option, you can display the same EBN, on a different position / size. In this case, the syntax of the Skin parameter is: "CP:ID Left Top Right Bottom" where the ID is the identifier of the EBN to be used ( it is a number that specifies the ID parameter of the Add method ), Left, Top, Right and Bottom parameters/numbers specifies the relative position to the part's client area, where the EBN should be rendered. The Left, Top, Right and Bottom parameters are numbers ( negative, zero or positive values, with no decimal ), that can be followed by the D character which indicates the value according to the current DPI settings. For instance, "CP:1 -2 -2 2 2", uses the EBN with the identifier 1, and displays it on a 2-pixels wider rectangle no matter of the DPI settings, while "CP:1 -2D -2D 2D 2D" displays it on a 2-pixels wider rectangle if DPI settings is 100%, and on on a 3-pixels wider rectangle if DPI settings is 150%.

The following screen shot shows the same EBN being displayed, using different CP options:

Return | Description
Boolean | A Boolean expression that indicates whether the new skin was added or replaced.
Use the Add method to add or replace skins to the control. The skin method, in it's simplest form, uses a single graphic file (*.ebn) assigned to a part of the control. By using a collection of objects laid over the graphic, it is possible to define which sections of the graphic will be used as borders, corners and other possible elements, fixing them to their proper position regardless of the size of the part. Use the Remove method to remove a specific skin from the control. Use the Clear method to remove all skins in the control. Use the Refresh method to refresh the control.

The identifier you choose for the skin is very important to be used in the background properties like explained bellow. Shortly, the color properties uses 4 bytes ( DWORD, double WORD, and so on ) to hold a RGB value. More than that, the first byte ( most significant byte in the color ) is used only to specify system color. if the first bit in the byte is 1, the rest of bits indicates the index of the system color being used. So, we use the last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. So, since the 7 bits can cover 127 values, excluding 0, we have 126 possibilities to store an identifier in that byte. This way, a DWORD expression indicates the background color stored in RRGGBB format and the index of the skin ( ID parameter ) in the last 7 bits in the high significant byte of the color. For instance, the BackColor = BackColor Or &H2000000 indicates that we apply the skin with the index 2 using the old color, to the object that BackColor is applied.

Starting with Windows XP, the following table shows how the common controls are broken into parts and states:

Control/ClassName | Part | States
BUTTON | BP_CHECKBOX = 3 | CBS_UNCHECKEDNORMAL = 1 CBS_UNCHECKEDHOT = 2 CBS_UNCHECKEDPRESSED = 3 CBS_UNCHECKEDDISABLED = 4 CBS_CHECKEDNORMAL = 5 CBS_CHECKEDHOT = 6 CBS_CHECKEDPRESSED = 7 CBS_CHECKEDDISABLED = 8 CBS_MIXEDNORMAL = 9 CBS_MIXEDHOT = 10 CBS_MIXEDPRESSED = 11 CBS_MIXEDDISABLED = 12
 | BP_GROUPBOX = 4 | GBS_NORMAL = 1 GBS_DISABLED = 2
 | BP_PUSHBUTTON = 1 | PBS_NORMAL = 1 PBS_HOT = 2 PBS_PRESSED = 3 PBS_DISABLED = 4 PBS_DEFAULTED = 5
 | BP_RADIOBUTTON = 2 | RBS_UNCHECKEDNORMAL = 1 RBS_UNCHECKEDHOT = 2 RBS_UNCHECKEDPRESSED = 3 RBS_UNCHECKEDDISABLED = 4 RBS_CHECKEDNORMAL = 5 RBS_CHECKEDHOT = 6 RBS_CHECKEDPRESSED = 7 RBS_CHECKEDDISABLED = 8
 | BP_USERBUTTON = 5 |
CLOCK | CLP_TIME = 1 | CLS_NORMAL = 1
COMBOBOX | CP_DROPDOWNBUTTON = 1 | CBXS_NORMAL = 1 CBXS_HOT = 2 CBXS_PRESSED = 3 CBXS_DISABLED = 4
EDIT | EP_CARET = 2 |
 | EP_EDITTEXT = 1 | ETS_NORMAL = 1 ETS_HOT = 2 ETS_SELECTED = 3 ETS_DISABLED = 4 ETS_FOCUSED = 5 ETS_READONLY = 6 ETS_ASSIST = 7
EXPLORERBAR | EBP_HEADERBACKGROUND = 1 |
 | EBP_HEADERCLOSE = 2 | EBHC_NORMAL = 1 EBHC_HOT = 2 EBHC_PRESSED = 3
 | EBP_HEADERPIN = 3 | EBHP_NORMAL = 1 EBHP_HOT = 2 EBHP_PRESSED = 3 EBHP_SELECTEDNORMAL = 4 EBHP_SELECTEDHOT = 5 EBHP_SELECTEDPRESSED = 6
 | EBP_IEBARMENU = 4 | EBM_NORMAL = 1 EBM_HOT = 2 EBM_PRESSED = 3
 | EBP_NORMALGROUPBACKGROUND = 5 |
 | EBP_NORMALGROUPCOLLAPSE = 6 | EBNGC_NORMAL = 1 EBNGC_HOT = 2 EBNGC_PRESSED = 3
 | EBP_NORMALGROUPEXPAND = 7 | EBNGE_NORMAL = 1 EBNGE_HOT = 2 EBNGE_PRESSED = 3
 | EBP_NORMALGROUPHEAD = 8 |
 | EBP_SPECIALGROUPBACKGROUND = 9 |
 | EBP_SPECIALGROUPCOLLAPSE = 10 | EBSGC_NORMAL = 1 EBSGC_HOT = 2 EBSGC_PRESSED = 3
 | EBP_SPECIALGROUPEXPAND = 11 | EBSGE_NORMAL = 1 EBSGE_HOT = 2 EBSGE_PRESSED = 3
 | EBP_SPECIALGROUPHEAD = 12 |
HEADER | HP_HEADERITEM = 1 | HIS_NORMAL = 1 HIS_HOT = 2 HIS_PRESSED = 3
 | HP_HEADERITEMLEFT = 2 | HILS_NORMAL = 1 HILS_HOT = 2 HILS_PRESSED = 3
 | HP_HEADERITEMRIGHT = 3 | HIRS_NORMAL = 1 HIRS_HOT = 2 HIRS_PRESSED = 3
 | HP_HEADERSORTARROW = 4 | HSAS_SORTEDUP = 1 HSAS_SORTEDDOWN = 2
LISTVIEW | LVP_EMPTYTEXT = 5 |
 | LVP_LISTDETAIL = 3 |
 | LVP_LISTGROUP = 2 |
 | LVP_LISTITEM = 1 | LIS_NORMAL = 1 LIS_HOT = 2 LIS_SELECTED = 3 LIS_DISABLED = 4 LIS_SELECTEDNOTFOCUS = 5
 | LVP_LISTSORTEDDETAIL = 4 |
MENU | MP_MENUBARDROPDOWN = 4 | MS_NORMAL = 1 MS_SELECTED = 2 MS_DEMOTED = 3
 | MP_MENUBARITEM = 3 | MS_NORMAL = 1 MS_SELECTED = 2 MS_DEMOTED = 3
 | MP_CHEVRON = 5 | MS_NORMAL = 1 MS_SELECTED = 2 MS_DEMOTED = 3
 | MP_MENUDROPDOWN = 2 | MS_NORMAL = 1 MS_SELECTED = 2 MS_DEMOTED = 3
 | MP_MENUITEM = 1 | MS_NORMAL = 1 MS_SELECTED = 2 MS_DEMOTED = 3
 | MP_SEPARATOR = 6 | MS_NORMAL = 1 MS_SELECTED = 2 MS_DEMOTED = 3
MENUBAND | MDP_NEWAPPBUTTON = 1 | MDS_NORMAL = 1 MDS_HOT = 2 MDS_PRESSED = 3 MDS_DISABLED = 4 MDS_CHECKED = 5 MDS_HOTCHECKED = 6
 | MDP_SEPERATOR = 2 |
PAGE | PGRP_DOWN = 2 | DNS_NORMAL = 1 DNS_HOT = 2 DNS_PRESSED = 3 DNS_DISABLED = 4
 | PGRP_DOWNHORZ = 4 | DNHZS_NORMAL = 1 DNHZS_HOT = 2 DNHZS_PRESSED = 3 DNHZS_DISABLED = 4
 | PGRP_UP = 1 | UPS_NORMAL = 1 UPS_HOT = 2 UPS_PRESSED = 3 UPS_DISABLED = 4
 | PGRP_UPHORZ = 3 | UPHZS_NORMAL = 1 UPHZS_HOT = 2 UPHZS_PRESSED = 3 UPHZS_DISABLED = 4
PROGRESS | PP_BAR = 1 |
 | PP_BARVERT = 2 |
 | PP_CHUNK = 3 |
 | PP_CHUNKVERT = 4 |
REBAR | RP_BAND = 3 |
 | RP_CHEVRON = 4 | CHEVS_NORMAL = 1 CHEVS_HOT = 2 CHEVS_PRESSED = 3
 | RP_CHEVRONVERT = 5 |
 | RP_GRIPPER = 1 |
 | RP_GRIPPERVERT = 2 |
SCROLLBAR | SBP_ARROWBTN = 1 | ABS_DOWNDISABLED, ABS_DOWNHOT, ABS_DOWNNORMAL, ABS_DOWNPRESSED, ABS_UPDISABLED, ABS_UPHOT, ABS_UPNORMAL, ABS_UPPRESSED, ABS_LEFTDISABLED, ABS_LEFTHOT, ABS_LEFTNORMAL, ABS_LEFTPRESSED, ABS_RIGHTDISABLED, ABS_RIGHTHOT, ABS_RIGHTNORMAL, ABS_RIGHTPRESSED
 | SBP_GRIPPERHORZ = 8 |
 | SBP_GRIPPERVERT = 9 |
 | SBP_LOWERTRACKHORZ = 4 | SCRBS_NORMAL = 1 SCRBS_HOT = 2 SCRBS_PRESSED = 3 SCRBS_DISABLED = 4
 | SBP_LOWERTRACKVERT = 6 | SCRBS_NORMAL = 1 SCRBS_HOT = 2 SCRBS_PRESSED = 3 SCRBS_DISABLED = 4
 | SBP_THUMBBTNHORZ = 2 | SCRBS_NORMAL = 1 SCRBS_HOT = 2 SCRBS_PRESSED = 3 SCRBS_DISABLED = 4
 | SBP_THUMBBTNVERT = 3 | SCRBS_NORMAL = 1 SCRBS_HOT = 2 SCRBS_PRESSED = 3 SCRBS_DISABLED = 4
 | SBP_UPPERTRACKHORZ = 5 | SCRBS_NORMAL = 1 SCRBS_HOT = 2 SCRBS_PRESSED = 3 SCRBS_DISABLED = 4
 | SBP_UPPERTRACKVERT = 7 | SCRBS_NORMAL = 1 SCRBS_HOT = 2 SCRBS_PRESSED = 3 SCRBS_DISABLED = 4
 | SBP_SIZEBOX = 10 | SZB_RIGHTALIGN = 1 SZB_LEFTALIGN = 2
SPIN | SPNP_DOWN = 2 | DNS_NORMAL = 1 DNS_HOT = 2 DNS_PRESSED = 3 DNS_DISABLED = 4
 | SPNP_DOWNHORZ = 4 | DNHZS_NORMAL = 1 DNHZS_HOT = 2 DNHZS_PRESSED = 3 DNHZS_DISABLED = 4
 | SPNP_UP = 1 | UPS_NORMAL = 1 UPS_HOT = 2 UPS_PRESSED = 3 UPS_DISABLED = 4
 | SPNP_UPHORZ = 3 | UPHZS_NORMAL = 1 UPHZS_HOT = 2 UPHZS_PRESSED = 3 UPHZS_DISABLED = 4
STARTPANEL | SPP_LOGOFF = 8 |
 | SPP_LOGOFFBUTTONS = 9 | SPLS_NORMAL = 1 SPLS_HOT = 2 SPLS_PRESSED = 3
 | SPP_MOREPROGRAMS = 2 |
 | SPP_MOREPROGRAMSARROW = 3 | SPS_NORMAL = 1 SPS_HOT = 2 SPS_PRESSED = 3
 | SPP_PLACESLIST = 6 |
 | SPP_PLACESLISTSEPARATOR = 7 |
 | SPP_PREVIEW = 11 |
 | SPP_PROGLIST = 4 |
 | SPP_PROGLISTSEPARATOR = 5 |
 | SPP_USERPANE = 1 |
 | SPP_USERPICTURE = 10 |
STATUS | SP_GRIPPER = 3 |
 | SP_PANE = 1 |
 | SP_GRIPPERPANE = 2 |
TAB | TABP_BODY = 10 |
 | TABP_PANE = 9 |
 | TABP_TABITEM = 1 | TIS_NORMAL = 1 TIS_HOT = 2 TIS_SELECTED = 3 TIS_DISABLED = 4 TIS_FOCUSED = 5
 | TABP_TABITEMBOTHEDGE = 4 | TIBES_NORMAL = 1 TIBES_HOT = 2 TIBES_SELECTED = 3 TIBES_DISABLED = 4 TIBES_FOCUSED = 5
 | TABP_TABITEMLEFTEDGE = 2 | TILES_NORMAL = 1 TILES_HOT = 2 TILES_SELECTED = 3 TILES_DISABLED = 4 TILES_FOCUSED = 5
 | TABP_TABITEMRIGHTEDGE = 3 | TIRES_NORMAL = 1 TIRES_HOT = 2 TIRES_SELECTED = 3 TIRES_DISABLED = 4 TIRES_FOCUSED = 5
 | TABP_TOPTABITEM = 5 | TTIS_NORMAL = 1 TTIS_HOT = 2 TTIS_SELECTED = 3 TTIS_DISABLED = 4 TTIS_FOCUSED = 5
 | TABP_TOPTABITEMBOTHEDGE = 8 | TTIBES_NORMAL = 1 TTIBES_HOT = 2 TTIBES_SELECTED = 3 TTIBES_DISABLED = 4 TTIBES_FOCUSED = 5
 | TABP_TOPTABITEMLEFTEDGE = 6 | TTILES_NORMAL = 1 TTILES_HOT = 2 TTILES_SELECTED = 3 TTILES_DISABLED = 4 TTILES_FOCUSED = 5
 | TABP_TOPTABITEMRIGHTEDGE = 7 | TTIRES_NORMAL = 1 TTIRES_HOT = 2 TTIRES_SELECTED = 3 TTIRES_DISABLED = 4 TTIRES_FOCUSED = 5
TASKBAND | TDP_GROUPCOUNT = 1 |
 | TDP_FLASHBUTTON = 2 |
 | TDP_FLASHBUTTONGROUPMENU = 3 |
TASKBAR | TBP_BACKGROUNDBOTTOM = 1 |
 | TBP_BACKGROUNDLEFT = 4 |
 | TBP_BACKGROUNDRIGHT = 2 |
 | TBP_BACKGROUNDTOP = 3 |
 | TBP_SIZINGBARBOTTOM = 5 |
 | TBP_SIZINGBARBOTTOMLEFT = 8 |
 | TBP_SIZINGBARRIGHT = 6 |
 | TBP_SIZINGBARTOP = 7 |
TOOLBAR | TP_BUTTON = 1 | TS_NORMAL = 1 TS_HOT = 2 TS_PRESSED = 3 TS_DISABLED = 4 TS_CHECKED = 5 TS_HOTCHECKED = 6
 | TP_DROPDOWNBUTTON = 2 | TS_NORMAL = 1 TS_HOT = 2 TS_PRESSED = 3 TS_DISABLED = 4 TS_CHECKED = 5 TS_HOTCHECKED = 6
 | TP_SPLITBUTTON = 3 | TS_NORMAL = 1 TS_HOT = 2 TS_PRESSED = 3 TS_DISABLED = 4 TS_CHECKED = 5 TS_HOTCHECKED = 6
 | TP_SPLITBUTTONDROPDOWN = 4 | TS_NORMAL = 1 TS_HOT = 2 TS_PRESSED = 3 TS_DISABLED = 4 TS_CHECKED = 5 TS_HOTCHECKED = 6
 | TP_SEPARATOR = 5 | TS_NORMAL = 1 TS_HOT = 2 TS_PRESSED = 3 TS_DISABLED = 4 TS_CHECKED = 5 TS_HOTCHECKED = 6
 | TP_SEPARATORVERT = 6 | TS_NORMAL = 1 TS_HOT = 2 TS_PRESSED = 3 TS_DISABLED = 4 TS_CHECKED = 5 TS_HOTCHECKED = 6
TOOLTIP | TTP_BALLOON = 3 | TTBS_NORMAL = 1 TTBS_LINK = 2
 | TTP_BALLOONTITLE = 4 | TTBS_NORMAL = 1 TTBS_LINK = 2
 | TTP_CLOSE = 5 | TTCS_NORMAL = 1 TTCS_HOT = 2 TTCS_PRESSED = 3
 | TTP_STANDARD = 1 | TTSS_NORMAL = 1 TTSS_LINK = 2
 | TTP_STANDARDTITLE = 2 | TTSS_NORMAL = 1 TTSS_LINK = 2
TRACKBAR | TKP_THUMB = 3 | TUS_NORMAL = 1 TUS_HOT = 2 TUS_PRESSED = 3 TUS_FOCUSED = 4 TUS_DISABLED = 5
 | TKP_THUMBBOTTOM = 4 | TUBS_NORMAL = 1 TUBS_HOT = 2 TUBS_PRESSED = 3 TUBS_FOCUSED = 4 TUBS_DISABLED = 5
 | TKP_THUMBLEFT = 7 | TUVLS_NORMAL = 1 TUVLS_HOT = 2 TUVLS_PRESSED = 3 TUVLS_FOCUSED = 4 TUVLS_DISABLED = 5
 | TKP_THUMBRIGHT = 8 | TUVRS_NORMAL = 1 TUVRS_HOT = 2 TUVRS_PRESSED = 3 TUVRS_FOCUSED = 4 TUVRS_DISABLED = 5
 | TKP_THUMBTOP = 5 | TUTS_NORMAL = 1 TUTS_HOT = 2 TUTS_PRESSED = 3 TUTS_FOCUSED = 4 TUTS_DISABLED = 5
 | TKP_THUMBVERT = 6 | TUVS_NORMAL = 1 TUVS_HOT = 2 TUVS_PRESSED = 3 TUVS_FOCUSED = 4 TUVS_DISABLED = 5
 | TKP_TICS = 9 | TSS_NORMAL = 1
 | TKP_TICSVERT = 10 | TSVS_NORMAL = 1
 | TKP_TRACK = 1 | TRS_NORMAL = 1
 | TKP_TRACKVERT = 2 | TRVS_NORMAL = 1
TRAYNOTIFY | TNP_ANIMBACKGROUND = 2 |
 | TNP_BACKGROUND = 1 |
TREEVIEW | TVP_BRANCH = 3 |
 | TVP_GLYPH = 2 | GLPS_CLOSED = 1 GLPS_OPENED = 2
 | TVP_TREEITEM = 1 | TREIS_NORMAL = 1 TREIS_HOT = 2 TREIS_SELECTED = 3 TREIS_DISABLED = 4 TREIS_SELECTEDNOTFOCUS = 5
WINDOW | WP_CAPTION = 1 | CS_ACTIVE = 1 CS_INACTIVE = 2 CS_DISABLED = 3
 | WP_CAPTIONSIZINGTEMPLATE = 30 |
 | WP_CLOSEBUTTON = 18 | CBS_NORMAL = 1 CBS_HOT = 2 CBS_PUSHED = 3 CBS_DISABLED = 4
 | WP_DIALOG = 29 |
 | WP_FRAMEBOTTOM = 9 | FS_ACTIVE = 1 FS_INACTIVE = 2
 | WP_FRAMEBOTTOMSIZINGTEMPLATE = 36 |
 | WP_FRAMELEFT = 7 | FS_ACTIVE = 1 FS_INACTIVE = 2
 | WP_FRAMELEFTSIZINGTEMPLATE = 32 |
 | WP_FRAMERIGHT = 8 | FS_ACTIVE = 1 FS_INACTIVE = 2
 | WP_FRAMERIGHTSIZINGTEMPLATE = 34 |
 | WP_HELPBUTTON = 23 | HBS_NORMAL = 1 HBS_HOT = 2 HBS_PUSHED = 3 HBS_DISABLED = 4
 | WP_HORZSCROLL = 25 | HSS_NORMAL = 1 HSS_HOT = 2 HSS_PUSHED = 3 HSS_DISABLED = 4
 | WP_HORZTHUMB = 26 | HTS_NORMAL = 1 HTS_HOT = 2 HTS_PUSHED = 3 HTS_DISABLED = 4
 | WP_MAX_BUTTON | MAXBS_NORMAL = 1 MAXBS_HOT = 2 MAXBS_PUSHED = 3 MAXBS_DISABLED = 4
 | WP_MAXCAPTION = 5 | MXCS_ACTIVE = 1 MXCS_INACTIVE = 2 MXCS_DISABLED = 3
 | WP_MDICLOSEBUTTON = 20 | CBS_NORMAL = 1 CBS_HOT = 2 CBS_PUSHED = 3 CBS_DISABLED = 4
 | WP_MDIHELPBUTTON = 24 | HBS_NORMAL = 1 HBS_HOT = 2 HBS_PUSHED = 3 HBS_DISABLED = 4
 | WP_MDIMINBUTTON = 16 | MINBS_NORMAL = 1 MINBS_HOT = 2 MINBS_PUSHED = 3 MINBS_DISABLED = 4
 | WP_MDIRESTOREBUTTON = 22 | RBS_NORMAL = 1 RBS_HOT = 2 RBS_PUSHED = 3 RBS_DISABLED = 4
 | WP_MDISYSBUTTON = 14 | SBS_NORMAL = 1 SBS_HOT = 2 SBS_PUSHED = 3 SBS_DISABLED = 4
 | WP_MINBUTTON = 15 | MINBS_NORMAL = 1 MINBS_HOT = 2 MINBS_PUSHED = 3 MINBS_DISABLED = 4
 | WP_MINCAPTION = 3 | MNCS_ACTIVE = 1 MNCS_INACTIVE = 2 MNCS_DISABLED = 3
 | WP_RESTOREBUTTON = 21 | RBS_NORMAL = 1 RBS_HOT = 2 RBS_PUSHED = 3 RBS_DISABLED = 4
 | WP_SMALLCAPTION = 2 | CS_ACTIVE = 1 CS_INACTIVE = 2 CS_DISABLED = 3
 | WP_SMALLCAPTIONSIZINGTEMPLATE = 31 |
 | WP_SMALLCLOSEBUTTON = 19 | CBS_NORMAL = 1 CBS_HOT = 2 CBS_PUSHED = 3 CBS_DISABLED = 4
 | WP_SMALLFRAMEBOTTOM = 12 | FS_ACTIVE = 1 FS_INACTIVE = 2
 | WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE = 37 |
 | WP_SMALLFRAMELEFT = 10 | FS_ACTIVE = 1 FS_INACTIVE = 2
 | WP_SMALLFRAMELEFTSIZINGTEMPLATE = 33 |
 | WP_SMALLFRAMERIGHT = 11 | FS_ACTIVE = 1 FS_INACTIVE = 2
 | WP_SMALLFRAMERIGHTSIZINGTEMPLATE = 35 |
 | WP_SMALLHELPBUTTON | HBS_NORMAL = 1 HBS_HOT = 2 HBS_PUSHED = 3 HBS_DISABLED = 4
 | WP_SMALLMAXBUTTON | MAXBS_NORMAL = 1 MAXBS_HOT = 2 MAXBS_PUSHED = 3 MAXBS_DISABLED = 4
 | WP_SMALLMAXCAPTION = 6 | MXCS_ACTIVE = 1 MXCS_INACTIVE = 2 MXCS_DISABLED = 3
 | WP_SMALLMINCAPTION = 4 | MNCS_ACTIVE = 1 MNCS_INACTIVE = 2 MNCS_DISABLED = 3
 | WP_SMALLRESTOREBUTTON | RBS_NORMAL = 1 RBS_HOT = 2 RBS_PUSHED = 3 RBS_DISABLED = 4
 | WP_SMALLSYSBUTTON | SBS_NORMAL = 1 SBS_HOT = 2 SBS_PUSHED = 3 SBS_DISABLED = 4
 | WP_SYSBUTTON = 13 | SBS_NORMAL = 1 SBS_HOT = 2 SBS_PUSHED = 3 SBS_DISABLED = 4
 | WP_VERTSCROLL = 27 | VSS_NORMAL = 1 VSS_HOT = 2 VSS_PUSHED = 3 VSS_DISABLED = 4
 | WP_VERTTHUMB = 28 | VTS_NORMAL = 1 VTS_HOT = 2 VTS_PUSHED = 3 VTS_DISABLED = 4


method Clear

method Appearance.Clear ()
Removes all skins in the control.

Type Description
Use the Clear method to clear all skins from the control. Use the Remove method to remove a specific skin. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.


method Remove

method Appearance.Remove (ID as Long)
Removes a specific skin from the control.

Type | Description
ID as Long | A Long expression that indicates the index of the skin being removed.
Use the Remove method to remove a specific skin. The identifier of the skin being removed should be the same as when the skin was added using the Add method. Use the Clear method to clear all skins from the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.


property RenderType

property Appearance.RenderType as Long
Specifies the way colored EBN objects are displayed on the component.

Type | Description
Long | A long expression that indicates how the EBN objects are shown in the control, like explained bellow.
By default, the RenderType property is 0, which indicates an A-color scheme. The RenderType property can be used to change the colors for the entire control, for parts of the controls that uses EBN objects. The RenderType property is not applied to the currently XP-theme if using.

The RenderType property is applied to all parts that displays an EBN object. The properties of color type may support the EBN object if the property's description includes "A color expression that indicates the cell's background color. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part." In other words, a property that supports EBN objects should be of format 0xIDRRGGBB, where the ID is the identifier of the EBN to be applied, while the BBGGRR is the (Red,Green,Blue, RGB-Color) color to be applied on the selected EBN. For instance, the 0x1000000 indicates displaying the EBN as it is, with no color applied, while the 0x1FF0000, applies the Blue color ( RGB(0x0,0x0,0xFF), RGB(0,0,255) on the EBN with the identifier 1. You can use the EBNColor tool to visualize applying EBN colors.

Click here [image] to watch a movie on how you can change the colors to be applied on EBN objects.

For instance, the following sample changes the control's header appearance, by using an EBN object:

With Control
    .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
    .Property = &H1000000
End With

In the following screen shot the following objects displays the current EBN with a different color:

  • "A" in Red ( RGB(255,0,0 ), for instance the bar's property exBarColor is 0x10000FF
  • "B" in Green ( RGB(0,255,0 ), for instance the bar's property exBarColor is 0x100FF00
  • "C" in Blue ( RGB(0,0,255 ), for instance the bar's property exBarColor is 0x1FF0000
  • "Default", no color is specified, for instance the bar's property exBarColor is 0x1000000

The RenderType property could be one of the following:

  • -3, no color is applied. For instance, the Property = &H1FF0000 is displayed as would be .Property = &H1000000, so the 0xFF0000 color ( Blue color ) is ignored. You can use this option to allow the control displays the EBN colors or not.

  • -2, OR-color scheme. The color to be applied on the part of the control is a OR bit combination between the original EBN color and the specified color. For instance, the Property = &H1FF0000, applies the OR bit for the entire Blue channel, or in other words, it applies a less Blue to the part of the control. This option should be used with solid colors (RGB(255,0,0), RGB(0,255,0), RGB(0,0,255), RGB(255,255,0), RGB(255,0,255), RGB(0,255,255),RGB(127,0,0),RGB(0,127,0), ... )

  • -1, AND-color scheme, The color to be applied on the part of the control is an AND bit combination between the original EBN color and the specified color. For instance, the Property = &H1FF0000, applies the AND bit for the entire Blue channel, or in other words, it applies a more Blue to the part of the control. This option should be used with solid colors (RGB(255,0,0), RGB(0,255,0), RGB(0,0,255), RGB(255,255,0), RGB(255,0,255), RGB(0,255,255),RGB(127,0,0),RGB(0,127,0), ... )

  • 0, default, the specified color is applied to the EBN. For instance, the Property = &H1FF0000, applies a Blue color to the object. This option could be used to specify any color for the part of the components, that support EBN objects, not only solid colors.

  • 0xAABBGGRR, where the AA a value between 0 to 255, which indicates the transparency, and RR, GG, BB the red, green and blue values. This option applies the same color to all parts that displays EBN objects, whit ignoring any specified color in the color property. For instance, the RenderType on 0x4000FFFF, indicates a 25% Yellow on EBN objects. The 0x40, or 64 in decimal, is a 25 % from in a 256 interal, and the 0x00FFFF, indicates the Yellow ( RGB(255,255,0) ). The same could be if the RenderType is 0x40000000 + vbYellow, or &H40000000 + RGB(255, 255, 0), and so, the RenderType could be the 0xAA000000 + Color, where the Color is the RGB format of the color.

The following picture shows the control with the RenderType property on 0x4000FFFF (25% Yellow, 0x40 or 64 in decimal is 25% from 256 ):

The following picture shows the control with the RenderType property on 0x8000FFFF (50% Yellow, 0x80 or 128 in decimal is 50% from 256 ):

The following picture shows the control with the RenderType property on 0xC000FFFF (75% Yellow, 0xC0 or 192 in decimal is 75% from 256 ):

The following picture shows the control with the RenderType property on 0xFF00FFFF (100% Yellow, 0xFF or 255 in decimal is 100% from 255 ):


Control object
The Control object holds properties to access the ActiveX or Window to be hosted by the item. The eXToolBar component can host any ActiveX control or an already created window. The Control object can be accessed through the SubControl property of the Item object. The Control object supports the following properties and methods:

Name | Description
CloseOn | Indicates when the control is closed.
ControlID | Specifies the control's identifier.
Create | Creates the component.
Height | Specifies the control's height.
LicenseKey | Specifies the control's runtime license key.
Object | Gets the object.
Width | Specifies the control's width.
Window | Specifies the handle of the window to be hosted.


property CloseOn

property Control.CloseOn as CloseOnEnum
Indicates when the control is closed.

Type | Description
CloseOnEnum | A CloseOnEnum expression that specifies when the popup menu is closed once the user clicks the inside ActiveX control.
By default, the CloseOn property is exUser. In other words, the popup menu is not closed once the user clicks the ActiveX control.


property ControlID

property Control.ControlID as String
Specifies the control's identifier.

Type | Description
String | A string expression that indicates the control's identifier.

The ControlID and LicenseKey properties must be set before calling Create method. The Create method creates an ActiveX control given its identifier and its runtime license key, if required. A control identifier, or programmatic identifier, is a registry entry that can be associated with a CLSID. The format of a control identifier is <Vendor>.<Component>.<Version>, separated by periods and with no spaces, as in Word.Document.6.

For instance, the control's identifier for Microsoft Calendar Control is "MSCAL.Calendar", the control's identifier for Exontrol ExGrid Control is "Exontrol.Grid", and so on.


method Create

method Control.Create ()
Creates the component.

Type Description
The Create method creates the ActiveX control. The Create method creates the control based on its control's identifier. Use the ControlID and LicenseKey properties to specify the control's identifier and the runtime license key for the control, if required ( please make sure that the runtime license key is not identical with your development license key ). If the Create method fails, the Object property gets nothing. Use the Object property to access the ActiveX control's properties and methods. Use the CloseOn property to specify how the item that hosts an ActiveX control is closed using the mouse. Use the Width and Height properties to specify the size of the item that hosts the ActiveX control. The control fires the OleEvent event when an inside ActiveX control fires an event. The look and feel of the inner ActiveX control depends on the identifier you are using, and the version of the library that implements the ActiveX control, so you need to consult the documentation of the inner ActiveX control you are inserting inside the eXMenu control.

In case you are using the /NET assembly version, you can use the Window property to assign a Window/Control to an Item.

The following screen shot displays an item with an ExCalendar inside:

The following samples shows how to load an ActiveX control ( Exontrol.Calendar )

VBA (MS Access, Excell...)

With ToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create()
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create()
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IControlPtr var_Control = spToolBar1->GetItems()->Add(L"Calendar",long(3),vtMissing)->GetSubControl();
    var_Control->PutWidth(256);
    var_Control->PutHeight(256);
    var_Control->PutControlID(L"Exontrol.Calendar");
    var_Control->Create();
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IControlPtr var_Control = ToolBar1->Items->Add(L"Calendar",TVariant(3),TNoParam())->SubControl;
    var_Control->Width = 256;
    var_Control->Height = 256;
    var_Control->ControlID = L"Exontrol.Calendar";
    var_Control->Create();
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Control var_Control = extoolbar1.Items.Add("Calendar",3,null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 256;
    var_Control.ControlID = "Exontrol.Calendar";
    var_Control.Create();
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Control = ToolBar1.Items.Add("Calendar",3,null).SubControl;
        var_Control.Width = 256;
        var_Control.Height = 256;
        var_Control.ControlID = "Exontrol.Calendar";
        var_Control.Create();
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items.Add("Calendar",3).SubControl
            .Width = 256
            .Height = 256
            .ControlID = "Exontrol.Calendar"
            .Create
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Control var_Control = axToolBar1.Items.Add("Calendar",3,null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 256;
    var_Control.ControlID = "Exontrol.Calendar";
    var_Control.Create();
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Control,com_Item;
    anytype var_Control,var_Item;
    ;

    super();

    var_Item = COM::createFromObject(extoolbar1.Items()).Add("Calendar",COMVariant::createFromInt(3)); com_Item = var_Item;
    var_Control = com_Item.SubControl(); com_Control = var_Control;
        com_Control.Width(256);
        com_Control.Height(256);
        com_Control.ControlID("Exontrol.Calendar");
        com_Control.Create();
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items.Add('Calendar',TObject(3),Nil).SubControl do
    begin
        Width := 256;
        Height := 256;
        ControlID := 'Exontrol.Calendar';
        Create();
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items.Add('Calendar',OleVariant(3),Null).SubControl do
    begin
        Width := 256;
        Height := 256;
        ControlID := 'Exontrol.Calendar';
        Create();
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Control

oToolBar = form.Activex1.nativeObject
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Control as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

Visual Objects

local var_Control as IControl

var_Control := oDCOCX_Exontrol1:Items:Add("Calendar",3,nil):SubControl
    var_Control:Width := 256
    var_Control:Height := 256
    var_Control:ControlID := "Exontrol.Calendar"
    var_Control:Create()
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Control

oToolBar = ole_1.Object
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Calendar" 3 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Variant voControl
            Get ComSubControl of hoItem to voControl
            Handle hoControl
            Get Create (RefClass(cComControl)) to hoControl
            Set pvComObject of hoControl to voControl
                Set ComWidth of hoControl to 256
                Set ComHeight of hoControl to 256
                Set ComControlID of hoControl to "Exontrol.Calendar"
                Send ComCreate of hoControl
            Send Destroy to hoControl
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oControl
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oControl := oToolBar:Items():Add("Calendar",3):SubControl()
            oControl:Width := 256
            oControl:Height := 256
            oControl:ControlID := "Exontrol.Calendar"
            oControl:Create()
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Height

property Control.Height as Long
Specifies the control's height.

Type | Description
Long | A long expression that indicates the control's height, in pixels.

By default, the Height property is 128 pixels. Use the Height property to specify the height of the inside control. The Height property has effect only if Create method is called after. Use the Width property to specify the control's width.


property LicenseKey

property Control.LicenseKey as String
Specifies the control's runtime license key.

Type | Description
String | A string expression that indicates the control's runtime license key.
The LicenseKey property must be set only if the control that you are going to use requires a runtime license key. Please contact the vendor of the control to know if the control requires a runtime license key. The control's runtime license key is not identical with your development license key. The LicenseKey property must be set before calling Create method. Please keep in mind that the vendor/provider of the ActiveX control you want to insert to an item is responsible for the control's runtime license key. Exontrol can provide the runtime license key for our components only.


property Object

property Control.Object as Object
Gets the object.

Type | Description
Object | An Object created by the Create method.
Use the Object property to access to control's properties and methods. The type of the created object depends on ControlID property. The Object property gets nothing if no object was created. Use the Create method to create the inside ActiveX control. The control fires the OleEvent event when an inside ActiveX control fires an event. The look and feel of the inner ActiveX control depends on the identifier you are using, and the version of the library that implements the ActiveX control, so you need to consult the documentation of the inner ActiveX control you are inserting inside the eXMenu control.

The following screen shot displays an item with an ExCalendar inside:


property Width

property Control.Width as Long
Specifies the control's width.

Type | Description
Long | A long expression that indicates the control's width in pixels.

By default, the Width property is 128 pixels. Use the Width property to specify the width of the inside control. The Width property has effect only if Create method is called after. Use the Height property to specify the control's height.


property Window

property Control.Window as Variant
Specifies the handle of the window to be hosted.

Type | Description
Variant | A Long expression that specifies the handle of the Window to be hosted by the Item.
Use the Window property to assign a Window to an item. The Window may be used by the /COM or /NET version by providing a valid handle to the window to be shown on the item. The /COM object may use the Create method to create an inside ActiveX control.

The following VB/NET sample displays the form's PropertyGrid control to an Item ( /NET version ):

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    ' Add 'exontrol.extoolbar.dll' reference to your project.
    With Extoolbar1
        With .Items
            With .Add("PropertiesGrid", 3).SubControl
                .Width = 256
                .Height = 312
                .Window = PropertyGrid1
            End With
        End With
    End With

    PropertyGrid1.SelectedObject = Extoolbar1

End Sub

The following C# sample displays the form's PropertyGrid control to an Item ( /NET version ):

private void Form1_Load(object sender, EventArgs e)
{
    exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Control var_Control = var_Items.Add("PropertiesGrid", 3, null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 312;
    var_Control.Window = propertyGrid1;

    propertyGrid1.SelectedObject = extoolbar1;

}


Item object
The Item object holds information about an item in the toolbar control. The Item property searches recursively the item with giving identifier/caption. The Item object supports the following properties and methods:

Name | Description
Alignment | Retrieves or sets the item's caption alignment.
AllowEdit | Retrieves or sets a value indicating whether the item contains an edit control.
BackColor | Specifies the background color of the item.
BackgroundExt | Indicates additional colors, text, images that can be displayed on the item's background using the EBN string format.
Bold | Specifies whether the item's caption should appear in bold.
Caption | Retrieves or sets a value that indicates the item's caption.
CaptionWidth | Specifies the fixed width to display the item's caption.
Check | Retrieves or sets a value that indicates whether the item is of check type.
Checked | Retrieves or sets a value that indicates the item's state.
CloseOnClick | Specifies the way the owner menu is closed once the user clicks the item.
Cursor | Specifies the shape of the cursor when mouse hovers the item.
EditBorder | Specifies the border for the inside edit control.
EditCaption | Specifies the edit's caption when the item contains an edit control.
EditMask | Specifies the edit's mask when the item contains an masked edit control.
EditOption | Specifies different options for item's edit control.
EditValue | Specifies the edit's value when the item contains an edit control.
EditWidth | Specifies the width for the inside edit control.
Enabled | Retrieves or sets a value that indicates whether the item is enabled or disabled.
ForeColor | Specifies the foreground color of the item.
ForegroundExt | Indicates additional colors, text, images that can be displayed on the item's foreground using the EBN string format.
GroupPopup | Specifies whether the items of the sub-menu are grouped and displayed on the current item.
HotBackColor | Specifies the hot background color of the item ( when the cursor hovers the item ).
HTMLImage | Retrieves or sets a value that indicates the key of the image (HTMLPicture method) to be displayed on the item ( left side ).
ID | Retrieves or sets a value that specifies the item's identifier.
Image | Retrieves or sets a value that indicates the item's index image.
Italic | Specifies whether the item's caption should appear in italic.
ItemHeight | Specifies the fixed height to display the item.
Items | Retrieves an Items collection that indicates the item's sub menu. Retrieves Nothing, if the item contains no sub menu.
ItemType | Returns the type of the item.
Padding | Specifies the padding (space between the menu border and the item content) to display the item.
Parent | Gets the item's parent, if the current item belongs to a submenu/popup.
Position | Specifies the position of the item, within its collection.
Radio | Retrieves or sets a value that indicates whether the item is of radio type.
RadioGroup | Indicates the group of radio items that the current item belongs.
SelBackColor | Specifies the background color of the item when it is selected.
SelHotBackColor | Specifies the background color of the selected item when the cursor hovers it.
Shortcut | Specifies the key combination that the user can press to select the item quickly.
ShowAsButton | Specifies whether the item is shown as a button.
ShowAsDisabled | Specifies whether the item is shown as disabled.
ShowCheckedAsSelected | Specifies whether the checked item shows as selected.
ShowLocalPopup | Specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.
ShowPopupAlign | Retrieves or sets a value that indicates how the item's sub-menu is aligned relative to the parent item.
ShowPopupArrow | Gets or sets a value that indicates whether an item that has a sub-menu shows or hides its popup arrow.
ShowPopupAt | Specifies the identifier of the item where the current item's submenu/popup is displayed.
ShowPopupOffset | Specifies the offset (horizontal,vertical) to display the item's submenu/popup relative to its default position.
ShowPopupOnChecked | Specifies whether the item's sub menu is shown only if the item is checked.
Strikeout | Specifies whether the item's caption should appear in strikeout.
SubControl | Retrieves the Control object that holds information about item's inside component.
SubMenu | Retrieves an Items collection that indicates the item's sub menu. Retrieves Nothing, if the item contains no sub menu.
Tab | Specifies the identifier of the item/tab where the current group popup is shown instead.
Tooltip | Specifies the item's tooltip.
TooltipTitle | Specifies the title of the item's tooltip.
ToString | Loads or saves the item using string representation.
Underline | Specifies whether the item's caption appears as underlined.
Update | Updates the item.
UserData | Associates an extra data to the object.
Visible | Specifies whether the item is visible or hidden.
X | Indicates the x-coordinate of the item relative to the control's view.
Y | Indicates the y-coordinate of the item relative to the control's view.


property Alignment

property Item.Alignment as AlignmentEnum
Retrieves or sets the item's caption alignment.

Type | Description
AlignmentEnum | An AlignmentEnum expression that specifies the item's
The Alignment property specifies the item's alignment. The Caption property supports built-in HTML format, so you can use the <c> to centers the item's caption or <r> to align to the right the item's caption.

How do I align the item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add "Item"
        With .Add("Item")
            .Alignment = 1
            .CaptionWidth = 128
        End With
        With .Add("Item")
            .Alignment = 2
            .CaptionWidth = 128
        End With
        .Add("").ToString = "Item[align=1]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add "Item"
        With .Add("Item")
            .Alignment = exCenter
            .CaptionWidth = 128
        End With
        With .Add("Item")
            .Alignment = exRight
            .CaptionWidth = 128
        End With
        .Add("").ToString = "Item[align=1]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .BackColor = Color.FromArgb(250,250,250)
        .Add("Item")
        With .Add("Item")
            .Alignment = exontrol.EXTOOLBARLib.AlignmentEnum.exCenter
            .CaptionWidth = 128
        End With
        With .Add("Item")
            .Alignment = exontrol.EXTOOLBARLib.AlignmentEnum.exRight
            .CaptionWidth = 128
        End With
        .Add("").ToString = "Item[align=1]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item")
        With .Add("Item")
            .Alignment = EXTOOLBARLib.AlignmentEnum.exCenter
            .CaptionWidth = 128
        End With
        With .Add("Item")
            .Alignment = EXTOOLBARLib.AlignmentEnum.exRight
            .CaptionWidth = 128
        End With
        .Add("").ToString = "Item[align=1]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->PutBackColor(RGB(250,250,250));
    var_Items->Add(L"Item",vtMissing,vtMissing);
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Item",vtMissing,vtMissing);
        var_Item->PutAlignment(EXTOOLBARLib::exCenter);
        var_Item->PutCaptionWidth(128);
    EXTOOLBARLib::IItemPtr var_Item1 = var_Items->Add(L"Item",vtMissing,vtMissing);
        var_Item1->PutAlignment(EXTOOLBARLib::exRight);
        var_Item1->PutCaptionWidth(128);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[align=1]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->BackColor = RGB(250,250,250);
    var_Items->Add(L"Item",TNoParam(),TNoParam());
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Item",TNoParam(),TNoParam());
        var_Item->Alignment = Extoolbarlib_tlb::AlignmentEnum::exCenter;
        var_Item->CaptionWidth = 128;
    Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items->Add(L"Item",TNoParam(),TNoParam());
        var_Item1->Alignment = Extoolbarlib_tlb::AlignmentEnum::exRight;
        var_Item1->CaptionWidth = 128;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[align=1]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.BackColor = Color.FromArgb(250,250,250);
    var_Items.Add("Item",null,null);
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Item",null,null);
        var_Item.Alignment = exontrol.EXTOOLBARLib.AlignmentEnum.exCenter;
        var_Item.CaptionWidth = 128;
    exontrol.EXTOOLBARLib.Item var_Item1 = var_Items.Add("Item",null,null);
        var_Item1.Alignment = exontrol.EXTOOLBARLib.AlignmentEnum.exRight;
        var_Item1.CaptionWidth = 128;
    var_Items.Add("",null,null).ToString = "Item[align=1]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.BackColor = 16448250;
        var_Items.Add("Item",null,null);
        var var_Item = var_Items.Add("Item",null,null);
            var_Item.Alignment = 1;
            var_Item.CaptionWidth = 128;
        var var_Item1 = var_Items.Add("Item",null,null);
            var_Item1.Alignment = 2;
            var_Item1.CaptionWidth = 128;
        var_Items.Add("",null,null).ToString = "Item[align=1]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .BackColor = RGB(250,250,250)
            .Add "Item"
            With .Add("Item")
                .Alignment = 1
                .CaptionWidth = 128
            End With
            With .Add("Item")
                .Alignment = 2
                .CaptionWidth = 128
            End With
            .Add("").ToString = "Item[align=1]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.BackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(250,250,250));
    var_Items.Add("Item",null,null);
    EXTOOLBARLib.Item var_Item = var_Items.Add("Item",null,null);
        var_Item.Alignment = EXTOOLBARLib.AlignmentEnum.exCenter;
        var_Item.CaptionWidth = 128;
    EXTOOLBARLib.Item var_Item1 = var_Items.Add("Item",null,null);
        var_Item1.Alignment = EXTOOLBARLib.AlignmentEnum.exRight;
        var_Item1.CaptionWidth = 128;
    var_Items.Add("",null,null).ToString = "Item[align=1]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Items;
    anytype var_Item,var_Item1,var_Item2,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.BackColor(WinApi::RGB2int(250,250,250));
        com_Items.Add("Item");
        var_Item = com_Items.Add("Item"); com_Item = var_Item;
            com_Item.Alignment(1/*exCenter*/);
            com_Item.CaptionWidth(128);
        var_Item1 = com_Items.Add("Item"); com_Item1 = var_Item1;
            com_Item1.Alignment(2/*exRight*/);
            com_Item1.CaptionWidth(128);
        var_Item2 = COM::createFromObject(com_Items.Add("")); com_Item2 = var_Item2;
        com_Item2.ToString("Item[align=1]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Nil,Nil);
        with Add('Item',Nil,Nil) do
        begin
            Alignment := EXTOOLBARLib.AlignmentEnum.exCenter;
            CaptionWidth := 128;
        end;
        with Add('Item',Nil,Nil) do
        begin
            Alignment := EXTOOLBARLib.AlignmentEnum.exRight;
            CaptionWidth := 128;
        end;
        Add('',Nil,Nil).ToString := 'Item[align=1]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Null,Null);
        with Add('Item',Null,Null) do
        begin
            Alignment := EXTOOLBARLib_TLB.exCenter;
            CaptionWidth := 128;
        end;
        with Add('Item',Null,Null) do
        begin
            Alignment := EXTOOLBARLib_TLB.exRight;
            CaptionWidth := 128;
        end;
        Add('',Null,Null).ToString := 'Item[align=1]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .BackColor = RGB(250,250,250)
        .Add("Item")
        with .Add("Item")
            .Alignment = 1
            .CaptionWidth = 128
        endwith
        with .Add("Item")
            .Alignment = 2
            .CaptionWidth = 128
        endwith
        .Add("").ToString = "Item[align=1]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.BackColor = 0xfafafa
    var_Items.Add("Item")
    var_Item = var_Items.Add("Item")
        var_Item.Alignment = 1
        var_Item.CaptionWidth = 128
    var_Item1 = var_Items.Add("Item")
        var_Item1.Alignment = 2
        var_Item1.CaptionWidth = 128
    // var_Items.Add("").ToString = "Item[align=1]"
    var_Item2 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item2]
        TemplateDef = var_Item2
        Template = [var_Item2.ToString = "Item[align=1]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.BackColor = 16448250
    var_Items.Add("Item")
    var_Item = var_Items.Add("Item")
        var_Item.Alignment = 1
        var_Item.CaptionWidth = 128
    var_Item1 = var_Items.Add("Item")
        var_Item1.Alignment = 2
        var_Item1.CaptionWidth = 128
    ' var_Items.Add("").ToString = "Item[align=1]"
    var_Item2 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item2"
    oToolBar.TemplateDef = var_Item2
    oToolBar.Template = "var_Item2.ToString = \"Item[align=1]\""

oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1 as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:BackColor := RGB(250,250,250)
    var_Items:Add("Item",nil,nil)
    var_Item := var_Items:Add("Item",nil,nil)
        var_Item:Alignment := exCenter
        var_Item:CaptionWidth := 128
    var_Item1 := var_Items:Add("Item",nil,nil)
        var_Item1:Alignment := exRight
        var_Item1:CaptionWidth := 128
    var_Items:Add("",nil,nil):ToString := "Item[align=1]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.BackColor = RGB(250,250,250)
    var_Items.Add("Item")
    var_Item = var_Items.Add("Item")
        var_Item.Alignment = 1
        var_Item.CaptionWidth = 128
    var_Item1 = var_Items.Add("Item")
        var_Item1.Alignment = 2
        var_Item1.CaptionWidth = 128
    var_Items.Add("").ToString = "Item[align=1]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Set ComBackColor of hoItems to (RGB(250,250,250))
        Get ComAdd of hoItems "Item" Nothing Nothing to Nothing
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAlignment of hoItem to OLEexCenter
            Set ComCaptionWidth of hoItem to 128
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComAlignment of hoItem1 to OLEexRight
            Set ComCaptionWidth of hoItem1 to 128
        Send Destroy to hoItem1
        Variant voItem2
        Get ComAdd of hoItems "" Nothing Nothing to voItem2
        Handle hoItem2
        Get Create (RefClass(cComItem)) to hoItem2
        Set pvComObject of hoItem2 to voItem2
            Set ComToString of hoItem2 to "Item[align=1]"
        Send Destroy to hoItem2
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 250,250,250 } )  , .F. ))
            oItems:Add("Item")
            oItem := oItems:Add("Item")
                oItem:Alignment := 1/*exCenter*/
                oItem:CaptionWidth := 128
            oItem1 := oItems:Add("Item")
                oItem1:Alignment := 2/*exRight*/
                oItem1:CaptionWidth := 128
            oItems:Add(""):ToString := "Item[align=1]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property AllowEdit

property Item.AllowEdit as AllowEditEnum
Retrieves or sets a value indicating whether the item contains an edit control.

Type | Description
AllowEditEnum | An AllowEditEnum expression that specifies whether the item displays an Edit field inside.
By default, the AllowEdit property is False, which indicates that the item displays no Edit field inside. Use the AllowEdit property to add a text-box inside the item, so the user can type any characters inside. The EditCaption property specifies the caption to be shown on the item's Edit text box. The EditWidth property specifies the width of the text-box inside the item. The EditBorder property specifies the border to be shown around the item's text box. You can use the Get method to collect all items of Edit type. The EditChange event notifies your application once the user alters the item's text-box caption. The EditOption property specifies different options to be used for a specified edit field. The ShowAsButton property specifies the whether the current item displays a button or a select button ( drop down ).

The following screen shot shows an item with a masking editor:

How can I add a vertical slider?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Vertical")
            .ItemHeight = 128
            .AllowEdit = 1027 ' AllowEditEnum.exItemEditVertical Or AllowEditEnum.exItemEditSlider
            .EditBorder = 0
            .EditWidth = 32
            .EditValue = 25
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Vertical")
            .ItemHeight = 128
            .AllowEdit = AllowEditEnum.exItemEditVertical Or AllowEditEnum.exItemEditSlider
            .EditBorder = exEditBorderNone
            .EditWidth = 32
            .EditValue = 25
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Vertical")
            .ItemHeight = 128
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditVertical Or exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditWidth = 32
            .EditValue = 25
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Vertical")
            .ItemHeight = 128
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditVertical Or EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditWidth = 32
            .EditValue = 25
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Vertical",vtMissing,vtMissing);
        var_Item->PutItemHeight(128);
        var_Item->PutAllowEdit(EXTOOLBARLib::AllowEditEnum(EXTOOLBARLib::exItemEditVertical | EXTOOLBARLib::exItemEditSlider));
        var_Item->PutEditBorder(EXTOOLBARLib::exEditBorderNone);
        var_Item->PutEditWidth(32);
        var_Item->PutEditValue(long(25));
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Vertical",TNoParam(),TNoParam());
        var_Item->ItemHeight = 128;
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditVertical | Extoolbarlib_tlb::AllowEditEnum::exItemEditSlider;
        var_Item->EditBorder = Extoolbarlib_tlb::EditBorderEnum::exEditBorderNone;
        var_Item->EditWidth = 32;
        var_Item->set_EditValue(TVariant(25));
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Vertical",null,null);
        var_Item.ItemHeight = 128;
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditVertical | exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item.EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item.EditWidth = 32;
        var_Item.EditValue = 25;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Vertical",null,null);
            var_Item.ItemHeight = 128;
            var_Item.AllowEdit = 1027;
            var_Item.EditBorder = 0;
            var_Item.EditWidth = 32;
            var_Item.EditValue = 25;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Vertical")
                .ItemHeight = 128
                .AllowEdit = 1027 ' AllowEditEnum.exItemEditVertical Or AllowEditEnum.exItemEditSlider
                .EditBorder = 0
                .EditWidth = 32
                .EditValue = 25
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Vertical",null,null);
        var_Item.ItemHeight = 128;
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditVertical | EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item.EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item.EditWidth = 32;
        var_Item.EditValue = 25;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Vertical"); com_Item = var_Item;
            com_Item.ItemHeight(128);
            com_Item.AllowEdit(1027/*exItemEditVertical | exItemEditSlider*/);
            com_Item.EditBorder(0/*exEditBorderNone*/);
            com_Item.EditWidth(32);
            com_Item.EditValue(COMVariant::createFromInt(25));
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Vertical',Nil,Nil) do
        begin
            ItemHeight := 128;
            AllowEdit := Integer(EXTOOLBARLib.AllowEditEnum.exItemEditVertical) Or Integer(EXTOOLBARLib.AllowEditEnum.exItemEditSlider);
            EditBorder := EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
            EditWidth := 32;
            EditValue := TObject(25);
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Vertical',Null,Null) do
        begin
            ItemHeight := 128;
            AllowEdit := Integer(EXTOOLBARLib_TLB.exItemEditVertical) Or Integer(EXTOOLBARLib_TLB.exItemEditSlider);
            EditBorder := EXTOOLBARLib_TLB.exEditBorderNone;
            EditWidth := 32;
            EditValue := OleVariant(25);
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Vertical")
            .ItemHeight = 128
            .AllowEdit = 1027 && AllowEditEnum.exItemEditVertical Or AllowEditEnum.exItemEditSlider
            .EditBorder = 0
            .EditWidth = 32
            .EditValue = 25
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Vertical")
        var_Item.ItemHeight = 128
        var_Item.AllowEdit = 1027 /*exItemEditVertical | exItemEditSlider*/
        var_Item.EditBorder = 0
        var_Item.EditWidth = 32
        var_Item.EditValue = 25
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Vertical")
        var_Item.ItemHeight = 128
        var_Item.AllowEdit = 1027 'exItemEditVertical + exItemEditSlider
        var_Item.EditBorder = 0
        var_Item.EditWidth = 32
        var_Item.EditValue = 25
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Vertical",nil,nil)
        var_Item:ItemHeight := 128
        var_Item:AllowEdit := exItemEditVertical | exItemEditSlider
        var_Item:EditBorder := exEditBorderNone
        var_Item:EditWidth := 32
        var_Item:EditValue := 25
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Vertical")
        var_Item.ItemHeight = 128
        var_Item.AllowEdit = 1027 /*exItemEditVertical | exItemEditSlider*/
        var_Item.EditBorder = 0
        var_Item.EditWidth = 32
        var_Item.EditValue = 25
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Vertical" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComItemHeight of hoItem to 128
            Set ComAllowEdit of hoItem to (OLEexItemEditVertical + OLEexItemEditSlider)
            Set ComEditBorder of hoItem to OLEexEditBorderNone
            Set ComEditWidth of hoItem to 32
            Set ComEditValue of hoItem to 25
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Vertical")
                oItem:ItemHeight := 128
                oItem:AllowEdit := 1027/*exItemEditVertical+exItemEditSlider*/
                oItem:EditBorder := 0/*exEditBorderNone*/
                oItem:EditWidth := 32
                oItem:EditValue := 25
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property BackColor

property Item.BackColor as Color
Specifies the item's background color of the item.

Type | Description
Color | A Color expression that specifies the item's background color. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The BackColor property specifies a different background color or a visual appearance for the item. The Caption property indicates the item's caption to be shown on the item. You can use the <bgcolor> HTML tag in the Caption property to specify a different background color for parts of the caption. The ForeColor property specifies the item's foreground color. The SelBackColor property specifies the item's background color when it is selected or highlighted. The HotBackColor property specifies a different background color or a visual appearance for the item, when the cursor hovers it. The SelHotBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked, and the cursor hovers it. The SelBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked.

How can I change the background color for a specified item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add "Item 1"
        .Add("Item 2").BackColor = RGB(255,0,0)
        .Add "Item 3"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add "Item 1"
        .Add("Item 2").BackColor = RGB(255,0,0)
        .Add "Item 3"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item 1")
        .Add("Item 2").BackColor = Color.FromArgb(255,0,0)
        .Add("Item 3")
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item 1")
        .Add("Item 2").BackColor = RGB(255,0,0)
        .Add("Item 3")
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item 1",vtMissing,vtMissing);
    var_Items->Add(L"Item 2",vtMissing,vtMissing)->PutBackColor(RGB(255,0,0));
    var_Items->Add(L"Item 3",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item 1",TNoParam(),TNoParam());
    var_Items->Add(L"Item 2",TNoParam(),TNoParam())->BackColor = RGB(255,0,0);
    var_Items->Add(L"Item 3",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null).BackColor = Color.FromArgb(255,0,0);
    var_Items.Add("Item 3",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item 1",null,null);
        var_Items.Add("Item 2",null,null).BackColor = 255;
        var_Items.Add("Item 3",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add "Item 1"
            .Add("Item 2").BackColor = RGB(255,0,0)
            .Add "Item 3"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null).BackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
    var_Items.Add("Item 3",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("Item 1");
        var_Item = COM::createFromObject(com_Items.Add("Item 2")); com_Item = var_Item;
        com_Item.BackColor(WinApi::RGB2int(255,0,0));
        com_Items.Add("Item 3");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Nil,Nil);
        Add('Item 2',Nil,Nil).BackColor := $ff;
        Add('Item 3',Nil,Nil);
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Null,Null);
        Add('Item 2',Null,Null).BackColor := $ff;
        Add('Item 3',Null,Null);
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item 1")
        .Add("Item 2").BackColor = RGB(255,0,0)
        .Add("Item 3")
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    // var_Items.Add("Item 2").BackColor = 0xff
    var_Item = var_Items.Add("Item 2")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.BackColor = 0xff]
    endwith
    var_Items.Add("Item 3")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    ' var_Items.Add("Item 2").BackColor = 255
    var_Item = var_Items.Add("Item 2")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.BackColor = 255"

    var_Items.Add("Item 3")
oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item 1",nil,nil)
    var_Items:Add("Item 2",nil,nil):BackColor := RGB(255,0,0)
    var_Items:Add("Item 3",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2").BackColor = RGB(255,0,0)
    var_Items.Add("Item 3")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "Item 1" Nothing Nothing to Nothing
        Variant voItem
        Get ComAdd of hoItems "Item 2" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComBackColor of hoItem to (RGB(255,0,0))
        Send Destroy to hoItem
        Get ComAdd of hoItems "Item 3" Nothing Nothing to Nothing
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item 1")
            oItems:Add("Item 2"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
            oItems:Add("Item 3")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property BackgroundExt

property Item.BackgroundExt as String
Indicates additional colors, text, images that can be displayed on the item's background using the EBN string format.

Type | Description
String | A String expression ( "EBN String Format" ) that defines the layout of the UI to be applied on the items' background. The syntax of EBN String Format in BNF notation is shown bellow. You can use the EBN's Builder of eXButton/COM control to define visually the EBN String Format.
By default, the BackgroundExt property is empty. Using the BackgroundExt property you have unlimited options to show any HTML text, images, colors, EBNs, patterns, frames anywhere on the item's background. For instance, let's say you need to display more colors on the item's background, or just want to display an additional caption or image to a specified location on the item's background. The EBN String Format defines the parts of the EBN to be applied on the item's background. The EBN is a set of UI elements that are built as a tree where each element is anchored to its parent element. The BackgroundExt property is applied right after setting the object's backcolor, and before drawing the default object's captions, icons or pictures. The BackgroundExt property is shown on the item's background, while the ForegroundExt property is shown on the item's foreground. Using the BackgroundExt property you have unlimited options to show any HTML text, images, colors, EBNs, patterns, frames anywhere on the items' background.

Easy samples:

  • "[pattern=6]", shows the BDiagonal pattern on the object's background.

  • "[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.

  • "[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.

  • "[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:

  • "top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.

  • "[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.

  • "[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.

  • "left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.

  • "bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.

  • "root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side

The Exontrol's eXButton WYSWYG Builder helps you to generate or view the EBN String Format, in the To String field as shown in the following screen shot:

The To String field of the EBN Builder defines the EBN String Format that can be used on BodyBackgroundExt property.

The EBN String Format syntax in BNF notation is defined like follows:

<EBN> ::= <elements> | <root> "(" [<elements>] ")"
<elements> ::= <element> [ "," <elements> ]
<root> ::= "root" [ <attributes> ] | [ <attributes> ]
<element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ]
<anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom"
<attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]"
<client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression>
<expression> ::= <number> | <number> "%"
<attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others>
<equal> ::= "="
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<decimal> ::= <digit><decimal>
<hexadigit> ::= <digit> | "A" | "B"  "C" | "D" | "E"  "F"
<hexa> ::= <hexadigit><hexa>
<number> ::= <decimal> | "0x" <hexa>
<color> ::= <rgbcolor> | number
<rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")"
<string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> "
<characters> ::= <char>|<characters>
<char> ::= <any_character_excepts_null>
<backcolor> ::= "back" <equal> <color>
<text> ::= "text" <equal> <string>
<align> ::= "align" <equal> <number>
<pattern> ::= "pattern" <equal> <number>
<patterncolor> ::= "patterncolor" <equal> <color>
<frame> ::= "frame" <equal> <color>
<data> ::= "data" <equal> <number> | <string>
<framethick> ::= "framethick"
<wordwrap> ::= "wordwrap"

Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.


property Bold

property Item.Bold as Boolean
Specifies whether the item's caption should appear in bold.

Type | Description
Boolean | A Boolean expression that specifies whether the item's caption is shown in bold.
By default, the Bold property is False. Use the Bold property to show the item's caption in bold. The Caption property indicates the HTML caption to be shown on the item. The <b> HTML tag can be used on the item's Caption property to specify different parts of the caption to be shown in bold.

How can I show the item in bold?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").Bold = True
        .Add "<b>Item</b>"
        .Add("").ToString = "Item[bld]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").Bold = True
        .Add "<b>Item</b>"
        .Add("").ToString = "Item[bld]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").Bold = True
        .Add("<b>Item</b>")
        .Add("").ToString = "Item[bld]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").Bold = True
        .Add("<b>Item</b>")
        .Add("").ToString = "Item[bld]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutBold(VARIANT_TRUE);
    var_Items->Add(L"<b>Item</b>",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[bld]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Bold = true;
    var_Items->Add(L"<b>Item</b>",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[bld]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Bold = true;
    var_Items.Add("<b>Item</b>",null,null);
    var_Items.Add("",null,null).ToString = "Item[bld]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Bold = true;
        var_Items.Add("<b>Item</b>",null,null);
        var_Items.Add("",null,null).ToString = "Item[bld]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Bold = True
            .Add "<b>Item</b>"
            .Add("").ToString = "Item[bld]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Bold = true;
    var_Items.Add("<b>Item</b>",null,null);
    var_Items.Add("",null,null).ToString = "Item[bld]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Bold(true);
        com_Items.Add("<b>Item</b>");
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[bld]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Bold := True;
        Add('<b>Item</b>',Nil,Nil);
        Add('',Nil,Nil).ToString := 'Item[bld]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Bold := True;
        Add('<b>Item</b>',Null,Null);
        Add('',Null,Null).ToString := 'Item[bld]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").Bold = .T.
        .Add("<b>Item</b>")
        .Add("").ToString = "Item[bld]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Bold = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Bold = true]
    endwith
    var_Items.Add("<b>Item</b>")
    // var_Items.Add("").ToString = "Item[bld]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[bld]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Bold = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Bold = True"

    var_Items.Add("<b>Item</b>")
    ' var_Items.Add("").ToString = "Item[bld]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[bld]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Bold := true
    var_Items:Add("<b>Item</b>",nil,nil)
    var_Items:Add("",nil,nil):ToString := "Item[bld]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Bold = true
    var_Items.Add("<b>Item</b>")
    var_Items.Add("").ToString = "Item[bld]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComBold of hoItem to True
        Send Destroy to hoItem
        Get ComAdd of hoItems "<b>Item</b>" Nothing Nothing to Nothing
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[bld]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):Bold := .T.
            oItems:Add("<b>Item</b>")
            oItems:Add(""):ToString := "Item[bld]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Caption

property Item.Caption as String
Retrieves or sets a value that indicates the item's caption.

Type | Description
String | A String expression that specifies the HTML caption to be displayed on the item.
Use the Caption property to specify the item's caption. Use the UserData property to associate any extra data to your items. Use the Tooltip property to specify the item's tooltip which can be shown when the cursor hovers the item. Use the Check property to assign a check-box to the item. Use the Radio property to assign a radio-button to the item. The ForeColor property of the Item object specifies a different foreground color for the entire item. The BackColor property of the Item object specifies a different background color / visual appearance for the entire item. The Item property searches recursively the item with giving identifier/caption. The AllowEdit property assigns an editor to an item. The CaptionWidth property specifies the fixed width to display the item's caption.

The Caption property supports the following HTML tags:

  • <b> ... </b> displays the text in bold
  • <i> ... </i> displays the text in italics
  • <u> ... </u> underlines the text
  • <s> ... </s> Strike-through text
  • <a id;options> ... </a> displays an anchor element that can be clicked. An anchor is a piece of text or some other object (for example an image) which marks the beginning and/or the end of a hypertext link.The <a> element is used to mark that piece of text (or inline image), and to give its hypertextual relationship to other documents. The control fires the AnchorClick(AnchorID, Options) event when the user clicks the anchor element. The FormatAnchor property customizes the visual effect for anchor elements.
  • <font face;size> ... </font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor rrggbb> ... </fgcolor> or <fgcolor=rrggbb> ... </fgcolor> displays text with a specified foreground color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <bgcolor rrggbb> ... </bgcolor> or <bgcolor=rrggbb> ... </bgcolor> displays text with a specified background color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <solidline rrggbb> ... </solidline> or <solidline=rrggbb> ... </solidline> draws a solid-line on the bottom side of the current text-line, of specified RGB color. The <solidline> ... </solidline> draws a black solid-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <dotline rrggbb> ... </dotline> or <dotline=rrggbb> ... </dotline> draws a dot-line on the bottom side of the current text-line, of specified RGB color. The <dotline> ... </dotline> draws a black dot-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <upline> ... </upline> draws the line on the top side of the current text-line (requires <solidline> or <dotline>).
  • <r> right aligns the text
  • <c> centers the text
  • <br> forces a line-break
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number; ( the character with specified code ), For instance, the &#8364; displays the EUR character. The & ampersand is only recognized as markup when it is followed by a known letter or a #character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;
  • <off offset> ... </off> defines the vertical offset to display the text/element. The offset parameter defines the offset to display the element. This tag is inheritable, so the offset is keep while the associated </off> tag is found. You can use the <off offset> HTML tag in combination with the <font face;size> to define a smaller or a larger font to be displayed. For instance: Text with <font ;7><off 6>subscript displays the text such as: Text with subscript The Text with <font ;7><off -6>superscript displays the text such as: Text with subscript
  • <gra rrggbb;mode;blend> ... </gra> defines a gradient text. The text color or <fgcolor> defines the starting gradient color, while the rr/gg/bb represents the red/green/blue values of the ending color, 808080 if missing as gray. The mode is a value between 0 and 4, 1 if missing, and blend could be 0 or 1, 0 if missing. The <font> HTML tag can be used to define the height of the font. Any of the rrggbb, mode or blend field may not be specified. The <gra> with no fields, shows a vertical gradient color from the current text color to gray (808080). For instance the <font ;18><gra FFFFFF;1;1>gradient-center</gra></font> generates the following picture:
  • <out rrggbb;width> ... </out> shows the text with outlined characters, where rr/gg/bb represents the red/green/blue values of the outline color, 808080 if missing as gray, width indicates the size of the outline, 1 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><out 000000><fgcolor=FFFFFF>outlined</fgcolor></out></font> generates the following picture:
  • <sha rrggbb;width;offset> ... </sha> define a text with a shadow, where rr/gg/bb represents the red/green/blue values of the shadow color, 808080 if missing as gray, width indicates the size of shadow, 4 if missing, and offset indicates the offset from the origin to display the text's shadow, 2 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><sha>shadow</sha></font> generates the following picture:

    or <font ;31><sha 404040;5;0><fgcolor=FFFFFF>outline anti-aliasing</fgcolor></sha></font> gets:


property CaptionWidth

property Item.CaptionWidth as Long
Specifies the fixed width to display the item's caption.

Type | Description
Long | A Long expression that specifies the width to display the item's caption.
By default, the CaptionWidth property is -1. If the CaptionWidth is negative, the caption expands the size of the item to fit entirely. If the CaptionWidth property is positive, it indicates the width to display the item's caption. The Caption property specifies the HTML caption to be displayed on the item. For instance, you can use the CaptionWidth to align editors of the items. The ItemHeight property specifies the height to show the item.

How can I specify the width of the item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").CaptionWidth = 128
        .Add("").ToString = "Item[captionwidth=128]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").CaptionWidth = 128
        .Add("").ToString = "Item[captionwidth=128]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .BackColor = Color.FromArgb(250,250,250)
        .Add("Item").CaptionWidth = 128
        .Add("").ToString = "Item[captionwidth=128]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").CaptionWidth = 128
        .Add("").ToString = "Item[captionwidth=128]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->PutBackColor(RGB(250,250,250));
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutCaptionWidth(128);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[captionwidth=128]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->BackColor = RGB(250,250,250);
    var_Items->Add(L"Item",TNoParam(),TNoParam())->CaptionWidth = 128;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[captionwidth=128]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.BackColor = Color.FromArgb(250,250,250);
    var_Items.Add("Item",null,null).CaptionWidth = 128;
    var_Items.Add("",null,null).ToString = "Item[captionwidth=128]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.BackColor = 16448250;
        var_Items.Add("Item",null,null).CaptionWidth = 128;
        var_Items.Add("",null,null).ToString = "Item[captionwidth=128]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .BackColor = RGB(250,250,250)
            .Add("Item").CaptionWidth = 128
            .Add("").ToString = "Item[captionwidth=128]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.BackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(250,250,250));
    var_Items.Add("Item",null,null).CaptionWidth = 128;
    var_Items.Add("",null,null).ToString = "Item[captionwidth=128]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.BackColor(WinApi::RGB2int(250,250,250));
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.CaptionWidth(128);
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[captionwidth=128]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Nil,Nil).CaptionWidth := 128;
        Add('',Nil,Nil).ToString := 'Item[captionwidth=128]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Null,Null).CaptionWidth := 128;
        Add('',Null,Null).ToString := 'Item[captionwidth=128]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").CaptionWidth = 128
        .Add("").ToString = "Item[captionwidth=128]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.BackColor = 0xfafafa
    // var_Items.Add("Item").CaptionWidth = 128
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.CaptionWidth = 128]
    endwith
    // var_Items.Add("").ToString = "Item[captionwidth=128]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[captionwidth=128]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.BackColor = 16448250
    ' var_Items.Add("Item").CaptionWidth = 128
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.CaptionWidth = 128"

    ' var_Items.Add("").ToString = "Item[captionwidth=128]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[captionwidth=128]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:BackColor := RGB(250,250,250)
    var_Items:Add("Item",nil,nil):CaptionWidth := 128
    var_Items:Add("",nil,nil):ToString := "Item[captionwidth=128]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.BackColor = RGB(250,250,250)
    var_Items.Add("Item").CaptionWidth = 128
    var_Items.Add("").ToString = "Item[captionwidth=128]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Set ComBackColor of hoItems to (RGB(250,250,250))
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComCaptionWidth of hoItem to 128
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[captionwidth=128]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 250,250,250 } )  , .F. ))
            oItems:Add("Item"):CaptionWidth := 128
            oItems:Add(""):ToString := "Item[captionwidth=128]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Check

property Item.Check as Boolean
Retrieves or sets a value that indicates whether the item is of check type.

Type | Description
Boolean | A Boolean expression that specifies whether the item displays a check box.
The Check property indicates whether the current item displays a check box. The Checked property specifies whether the item is checked or un-checked. The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked inside. The GetChecked property gets a collection of checked items. The GetUnchecked property gets a collection of checked items. The GetRadio method gets a safe array with the radio-items being checked within a radio group. Use the Background(exCheckBoxState0)/Background(exCheckBoxState1) property to specify the visual appearance of the check-boxes in the control. Use the UseVisualTheme property to specify whether the visual appearance for the check-boxes to be as indicated by the current XP theme. Use the ShowCheckedAsSelected property on True, to show the checked items as selected.

How can I add check-buttons?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",vtMissing,vtMissing);
                var_Item1->PutCheck(VARIANT_TRUE);
                var_Item1->PutChecked(VARIANT_TRUE);
            var_Items1->Add(L"Check 2",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",TNoParam(),TNoParam());
                var_Item1->Check = true;
                var_Item1->Checked = true;
            var_Items1->Add(L"Check 2",TNoParam(),TNoParam())->Check = true;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
            var_Items1.Add("Check 2",null,null).Check = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Check 1",null,null);
                    var_Item1.Check = true;
                    var_Item1.Checked = true;
                var_Items1.Add("Check 2",null,null).Check = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    With .Add("Check 1")
                        .Check = True
                        .Checked = True
                    End With
                    .Add("Check 2").Check = True
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
            var_Items1.Add("Check 2",null,null).Check = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Item2,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Check 1"); com_Item1 = var_Item1;
                    com_Item1.Check(true);
                    com_Item1.Checked(true);
                var_Item2 = COM::createFromObject(com_Items1.Add("Check 2")); com_Item2 = var_Item2;
                com_Item2.Check(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Nil,Nil) do
                begin
                    Check := True;
                    Checked := True;
                end;
                Add('Check 2',Nil,Nil).Check := True;
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Null,Null) do
                begin
                    Check := True;
                    Checked := True;
                end;
                Add('Check 2',Null,Null).Check := True;
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                with .Add("Check 1")
                    .Check = .T.
                    .Checked = .T.
                endwith
                .Add("Check 2").Check = .T.
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
            // var_Items1.Add("Check 2").Check = true
            var_Item2 = var_Items1.Add("Check 2")
            with (oToolBar)
                TemplateDef = [Dim var_Item2]
                TemplateDef = var_Item2
                Template = [var_Item2.Check = true]
            endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = .t.
                var_Item1.Checked = .t.
            ' var_Items1.Add("Check 2").Check = .t.
            var_Item2 = var_Items1.Add("Check 2")
            oToolBar.TemplateDef = "Dim var_Item2"
            oToolBar.TemplateDef = var_Item2
            oToolBar.Template = "var_Item2.Check = True"

oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Check 1",nil,nil)
                var_Item1:Check := true
                var_Item1:Checked := true
            var_Items1:Add("Check 2",nil,nil):Check := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
            var_Items1.Add("Check 2").Check = true
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Check 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComCheck of hoItem1 to True
                    Set ComChecked of hoItem1 to True
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Check 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComCheck of hoItem2 to True
                Send Destroy to hoItem2
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Check 1")
                        oItem1:Check := .T.
                        oItem1:Checked := .T.
                    oItems1:Add("Check 2"):Check := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Checked

property Item.Checked as Boolean
Retrieves or sets a value that indicates the item's state.

Type | Description
Boolean | A Boolean expression that indicates whether the item is checked or unchecked.
The Checked property specifies whether the item is checked or un-checked. The Check property indicates whether the current item displays a check box. The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked inside. The GetChecked property gets a collection of checked items. The GetUnchecked property gets a collection of checked items. The GetRadio method gets a safe array with the radio-items being checked within a radio group. The AllowToggleRadio property on True, allows a radio button to set on zero ( unchecked ), if the user clicks twice the radio button. Usually, clicking a radio-button makes the previously checked radio-button in the same group, to be un-checked, and the newly clicked item to be checked. Now, if the AllowToggleRadio property is True, clicking again the radio-button, allows the radio-button to be un-checked, so allows a radio group to have no radio button checked. Use the ShowCheckedAsSelected property on True, to show the checked items as selected.

How can I add check-buttons?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",vtMissing,vtMissing);
                var_Item1->PutCheck(VARIANT_TRUE);
                var_Item1->PutChecked(VARIANT_TRUE);
            var_Items1->Add(L"Check 2",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",TNoParam(),TNoParam());
                var_Item1->Check = true;
                var_Item1->Checked = true;
            var_Items1->Add(L"Check 2",TNoParam(),TNoParam())->Check = true;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
            var_Items1.Add("Check 2",null,null).Check = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Check 1",null,null);
                    var_Item1.Check = true;
                    var_Item1.Checked = true;
                var_Items1.Add("Check 2",null,null).Check = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    With .Add("Check 1")
                        .Check = True
                        .Checked = True
                    End With
                    .Add("Check 2").Check = True
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
            var_Items1.Add("Check 2",null,null).Check = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Item2,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Check 1"); com_Item1 = var_Item1;
                    com_Item1.Check(true);
                    com_Item1.Checked(true);
                var_Item2 = COM::createFromObject(com_Items1.Add("Check 2")); com_Item2 = var_Item2;
                com_Item2.Check(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Nil,Nil) do
                begin
                    Check := True;
                    Checked := True;
                end;
                Add('Check 2',Nil,Nil).Check := True;
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Null,Null) do
                begin
                    Check := True;
                    Checked := True;
                end;
                Add('Check 2',Null,Null).Check := True;
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                with .Add("Check 1")
                    .Check = .T.
                    .Checked = .T.
                endwith
                .Add("Check 2").Check = .T.
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
            // var_Items1.Add("Check 2").Check = true
            var_Item2 = var_Items1.Add("Check 2")
            with (oToolBar)
                TemplateDef = [Dim var_Item2]
                TemplateDef = var_Item2
                Template = [var_Item2.Check = true]
            endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = .t.
                var_Item1.Checked = .t.
            ' var_Items1.Add("Check 2").Check = .t.
            var_Item2 = var_Items1.Add("Check 2")
            oToolBar.TemplateDef = "Dim var_Item2"
            oToolBar.TemplateDef = var_Item2
            oToolBar.Template = "var_Item2.Check = True"

oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Check 1",nil,nil)
                var_Item1:Check := true
                var_Item1:Checked := true
            var_Items1:Add("Check 2",nil,nil):Check := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
            var_Items1.Add("Check 2").Check = true
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Check 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComCheck of hoItem1 to True
                    Set ComChecked of hoItem1 to True
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Check 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComCheck of hoItem2 to True
                Send Destroy to hoItem2
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Check 1")
                        oItem1:Check := .T.
                        oItem1:Checked := .T.
                    oItems1:Add("Check 2"):Check := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property CloseOnClick

property Item.CloseOnClick as CloseOnClickEnum
Specifies the way the owner menu is closed once the user clicks the item.

Type | Description
CloseOnClickEnum | A CloseOnClickEnum expression that determines the way the hosting menu is closed when the user clicks the item.
You can specify a different way of closing the current item by specifying a different value for Item's CloseOnClick property. For instance, you can specify the Item's CloseOnClick property on exCloseOnClickOutside, for items of button type, so the hosting menu won't be closed when the user clicks the button, and so the user can click multiple times the item without closing the menu. The ShowAsButton property indicates whether the item should look as a button. The ShowLocalPopup property specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.


property Cursor

property Item.Cursor as Variant
Specifies the shape of the cursor when mouse hovers the item.

Type | Description
Variant | A String expression that defines the cursor to be shown when the cursor hovers the item. The Valid values are listed bellow. Also the Cursor property could point to a cursor file to be loaded and shown while the cursor hovers the item.
By default, the Cursor property is "exDefault". Use the Cursor property of the Item object to specify a different cursor when it hovers the item only. Use the Cursor property to specify a different cursor when it hovers the toolbar control.

The supported values are:

  • "exDefault", Standard arrow
  • "exArrow", Standard arrow
  • "exCross", Crosshair
  • "exIBeam", I-beam
  • "exIcon", Reserved
  • "exSize", Reserved, use the "exSizeAll"
  • "exSizeNESW", Double-pointed arrow pointing northeast and southwest
  • "exSizeNS", Double-pointed arrow pointing north and south
  • "exSizeNWSE", Double-pointed arrow pointing northwest and southeast
  • "exSizeWE", Double-pointed arrow pointing west and east
  • "exUpArrow", Vertical arrow
  • "exHourglass", Hourglass
  • "exNoDrop", Slashed circle
  • "exArrowHourglass"
  • "exHelp", Arrow and question mark
  • "exSizeAll", Four-pointed arrow pointing north, south, east, and west
  • "exHand", Hand

Any other value indicates the path to a cursor file to be displayed when the pointer hovers the toolbar control/item.

Can I change the cursor where it hovers the item?

VBA (MS Access, Excell...)

With ToolBar1
    .Cursor = "exCross"
    With .Items
        .Add "Item 1"
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh
End With

VB6

With ToolBar1
    .Cursor = "exCross"
    With .Items
        .Add "Item 1"
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .Cursor = "exCross"
    With .Items
        .Add("Item 1")
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .Cursor = "exCross"
    With .Items
        .Add("Item 1")
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutCursor("exCross");
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item 1",vtMissing,vtMissing);
    var_Items->Add(L"Item 2",vtMissing,vtMissing)->PutCursor("exNoDrop");
spToolBar1->Refresh();

C++ Builder

ToolBar1->set_Cursor(TVariant("exCross"));
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item 1",TNoParam(),TNoParam());
    var_Items->Add(L"Item 2",TNoParam(),TNoParam())->set_Cursor(TVariant("exNoDrop"));
ToolBar1->Refresh();

C#

extoolbar1.Cursor = "exCross";
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null).Cursor = "exNoDrop";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.Cursor = "exCross";
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item 1",null,null);
        var_Items.Add("Item 2",null,null).Cursor = "exNoDrop";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .Cursor = "exCross"
        With .Items
            .Add "Item 1"
            .Add("Item 2").Cursor = "exNoDrop"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.Cursor = "exCross";
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null).Cursor = "exNoDrop";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    extoolbar1.Cursor("exCross");
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("Item 1");
        var_Item = COM::createFromObject(com_Items.Add("Item 2")); com_Item = var_Item;
        com_Item.Cursor("exNoDrop");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    Cursor := 'exCross';
    with Items do
    begin
        Add('Item 1',Nil,Nil);
        Add('Item 2',Nil,Nil).Cursor := 'exNoDrop';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    Cursor := 'exCross';
    with Items do
    begin
        Add('Item 1',Null,Null);
        Add('Item 2',Null,Null).Cursor := 'exNoDrop';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .Cursor = "exCross"
    with .Items
        .Add("Item 1")
        .Add("Item 2").Cursor = "exNoDrop"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.Cursor = "exCross"
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    // var_Items.Add("Item 2").Cursor = "exNoDrop"
    var_Item = var_Items.Add("Item 2")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Cursor = "exNoDrop"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.Cursor = "exCross"
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    ' var_Items.Add("Item 2").Cursor = "exNoDrop"
    var_Item = var_Items.Add("Item 2")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Cursor = \"exNoDrop\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

oDCOCX_Exontrol1:Cursor := "exCross"
var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item 1",nil,nil)
    var_Items:Add("Item 2",nil,nil):Cursor := "exNoDrop"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
oToolBar.Cursor = "exCross"
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2").Cursor = "exNoDrop"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Set ComCursor to "exCross"
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "Item 1" Nothing Nothing to Nothing
        Variant voItem
        Get ComAdd of hoItems "Item 2" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComCursor of hoItem to "exNoDrop"
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:Cursor := "exCross"
        oItems := oToolBar:Items()
            oItems:Add("Item 1")
            oItems:Add("Item 2"):Cursor := "exNoDrop"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property EditBorder

property Item.EditBorder as EditBorderEnum
Specifies the border for the inside edit control.

Type | Description
EditBorderEnum | An EditBorderEnum expression that specifies the border to be shown around the item's text box.
The EditBorder property specifies the border to be shown around the item's text box. The EditCaption property specifies the caption to be shown on the item's Edit text box. Use the AllowEdit property to add a text-box inside the item, so the user can type any characters inside. The EditWidth property specifies the width of the text-box inside the item. You can use the Get method to collect all items of Edit type. The EditChange event notifies your application once the user alters the item's text-box caption.

How can I change/hide the editor's border?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Text")
            .AllowEdit = 1
            .EditBorder = -1
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Text")
            .AllowEdit = exItemEditText
            .EditBorder = exEditBorderInset
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Text")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditText
            .EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderInset
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Text")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditText
            .EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderInset
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Text",vtMissing,vtMissing);
        var_Item->PutAllowEdit(EXTOOLBARLib::exItemEditText);
        var_Item->PutEditBorder(EXTOOLBARLib::exEditBorderInset);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Text",TNoParam(),TNoParam());
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditText;
        var_Item->EditBorder = Extoolbarlib_tlb::EditBorderEnum::exEditBorderInset;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Text",null,null);
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditText;
        var_Item.EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderInset;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Text",null,null);
            var_Item.AllowEdit = 1;
            var_Item.EditBorder = -1;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Text")
                .AllowEdit = 1
                .EditBorder = -1
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Text",null,null);
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditText;
        var_Item.EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderInset;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Text"); com_Item = var_Item;
            com_Item.AllowEdit(1/*exItemEditText*/);
            com_Item.EditBorder(-1/*exEditBorderInset*/);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Text',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditText;
            EditBorder := EXTOOLBARLib.EditBorderEnum.exEditBorderInset;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Text',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditText;
            EditBorder := EXTOOLBARLib_TLB.exEditBorderInset;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Text")
            .AllowEdit = 1
            .EditBorder = -1
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Text")
        var_Item.AllowEdit = 1
        var_Item.EditBorder = -1
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Text")
        var_Item.AllowEdit = 1
        var_Item.EditBorder = -1
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Text",nil,nil)
        var_Item:AllowEdit := exItemEditText
        var_Item:EditBorder := exEditBorderInset
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Text")
        var_Item.AllowEdit = 1
        var_Item.EditBorder = -1
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Text" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAllowEdit of hoItem to OLEexItemEditText
            Set ComEditBorder of hoItem to OLEexEditBorderInset
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Text")
                oItem:AllowEdit := 1/*exItemEditText*/
                oItem:EditBorder := -1/*exEditBorderInset*/
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property EditCaption

property Item.EditCaption as String
Specifies the edit's caption when the item contains an edit control.

Type | Description
String | A String expression that specifies the caption to be shown on the item's text box.
The EditCaption property specifies the caption to be shown on the item's Edit text box. Use the AllowEdit property to add a text-box inside the item, so the user can type any characters inside. The EditWidth property specifies the width of the text-box inside the item. The EditBorder property specifies the border to be shown around the item's text box. You can use the Get method to collect all items of Edit type. The EditChange event notifies your application once the user alters the item's text-box caption. The EditValue property indicates the edit's value.

How can I change the edit's caption?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Text")
            .AllowEdit = 1
            .EditCaption = "caption"
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Text")
            .AllowEdit = exItemEditText
            .EditCaption = "caption"
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Text")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditText
            .EditCaption = "caption"
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Text")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditText
            .EditCaption = "caption"
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Text",vtMissing,vtMissing);
        var_Item->PutAllowEdit(EXTOOLBARLib::exItemEditText);
        var_Item->PutEditCaption(L"caption");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Text",TNoParam(),TNoParam());
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditText;
        var_Item->EditCaption = L"caption";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Text",null,null);
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditText;
        var_Item.EditCaption = "caption";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Text",null,null);
            var_Item.AllowEdit = 1;
            var_Item.EditCaption = "caption";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Text")
                .AllowEdit = 1
                .EditCaption = "caption"
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Text",null,null);
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditText;
        var_Item.EditCaption = "caption";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Text"); com_Item = var_Item;
            com_Item.AllowEdit(1/*exItemEditText*/);
            com_Item.EditCaption("caption");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Text',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditText;
            EditCaption := 'caption';
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Text',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditText;
            EditCaption := 'caption';
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Text")
            .AllowEdit = 1
            .EditCaption = "caption"
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Text")
        var_Item.AllowEdit = 1
        var_Item.EditCaption = "caption"
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Text")
        var_Item.AllowEdit = 1
        var_Item.EditCaption = "caption"
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Text",nil,nil)
        var_Item:AllowEdit := exItemEditText
        var_Item:EditCaption := "caption"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Text")
        var_Item.AllowEdit = 1
        var_Item.EditCaption = "caption"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Text" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAllowEdit of hoItem to OLEexItemEditText
            Set ComEditCaption of hoItem to "caption"
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Text")
                oItem:AllowEdit := 1/*exItemEditText*/
                oItem:EditCaption := "caption"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property EditMask

property Item.EditMask as String
Specifies the edit's mask when the item contains an masked edit control.

Type | Description
String | A string expression that indicates the mask of the edit's field.
By default, the EditMask property is "" ( empty string, no masking ). The EditMask property is valid for exItemEditMask editors. The AllowEdit property associates an editor to the current item. The EditMask property specifies the mask of the edit field. The EditValue property specifies the value of the edit field, without the masking characters. The EditOption(exEditMaskFloat) specifies whether the edit field mask a floating/decimal/integer point number. The EditMask property depends on the EditOption(exEditMaskFloat) value, as explained bellow.

A) If the EditOption(exEditMaskFloat) property is False ( by default ), the EditMask is defined such as:

For instance, the following input-mask ( ext-phone )

!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid character,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."

indicates the following:

  • The pattern should contain 3 optional digits 999, and 7 required digits 000 0000, aligned to the right, !.
  • The second part of the input mask indicates 1, which means that all literals are included when the user leaves the field.
  • The entire field is selected when it receives the focus, select=1
  • The field supports empty value, so the user can leave the field with no content
  • The field enters in overtype mode, and insert-type mode is not allowed when user pressed the Insert key
  • If the user enters any invalid character, a warning tooltip with the message "invalid character" is displayed.
  • If the user tries to leave the field, while the field is not validated ( all 7 required digits completed ), the invalid tooltip is shown with the message "The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." The <%mask%> is replaced with the first part of the input mask !(999) 000 0000

The four parts of an input mask, or the Mask property supports up to four parts, separated by a semicolon (;). For instance, "`Time: `00:00:00;;0;overtype,warning=<fgcolor FF0000>invalid character,beep", indicates the pattern "00:00" with the prefix Time:, the masking character being the 0, instead _, the field enters in over-type mode, insert-type mode is not allowed, and the field beeps and displays a tooltip in red with the message invalid character when the user enters an invalid character.

Input masks are made up one mandatory part and three optional parts, and each part is separated by a semicolon (;). If a part should use the semicolon (;) it must uses the \; instead

The purpose of each part is as follows:

  1. The first part (pattern) is mandatory. It includes the mask characters or string (series of characters) along with placeholders and literal data such as, parentheses, periods, and hyphens.

    The following table lists the placeholder and literal characters for an input mask and explains how it controls data entry:

    • #, a digit, +, - or space (entry not required).
    • 0, a digit (0 through 9, entry required; plus [+] and minus [-] signs not allowed).
    • 9, a digit or space (entry not required; plus and minus signs not allowed).
    • x, a lower case hexa character, [0-9],[a-f] ( entry required )
    • X, an upper case hexa character, [0-9],[A-F] ( entry required )
    • A, any letter, digit (entry required).
    • a, any letter, digit or space (entry optional).
    • L, any letter (entry require).
    • ?, any letter or space (entry optional).
    • &, any character or a space (entry required).
    • C, any character or a space (entry optional).
    • >, any letter, converted to uppercase (entry required).
    • <, any letter, converted to lowercase (entry required).
    • *, any characters combinations
    • { min,max } (Range), indicates a number range. The syntax {min,max} (Range), masks a number in the giving range. The min and max values should be positive integers. For instance the mask {0,255} masks any number between 0 and 255.
    • [...] (Alternative), masks any characters that are contained in the [] brackets. For instance, the [abcdA-D] mask any character: a,b,c,d,A,B,C,D
    • \, indicates the escape character
    • », ( ALT + 175 ) causes the characters that follow to be converted to uppercase, until «( ALT + 174 ) is found.
    • «, ( ALT + 174 ) causes the characters that follow to be converted to lowercase, until »( ALT + 175 ) is found.
    • !, causes the input mask to fill from right to left instead of from left to right.

    Characters enclosed in double quotation ("" or ``) marks will be displayed literally. If this part should display/use the semicolon (;) character is should be included between double quotation ("" or ``) characters or as \; ( escape ).

  2. The second part is optional and refers to the embedded mask characters and how they are stored within the field. If the second part is set to 0 ( default, exClipModeLiteralsNone ), all characters are stored with the data, and if it is set to 1 (exClipModeLiteralsInclude), the literals are stored, not including the masking/placeholder characters, if 2 (exClipModeLiteralsExclude), just typed characters are stored, if 3(exClipModeLiteralsEscape), optional, required, editable and escaped entities are included. No double quoted text is included.
  3. The third part of the input mask is also optional and indicates a single character or space that is used as a placeholder. By default, the field uses the underscore (_). If you want to use another character, enter it in the third part of your mask. Only the first character is considered. If this part should display/use the semicolon (;) character is should be \; ( escape )
  4. The forth part of the input, indicates a list of options that can be applied to input mask, separated by comma(,) character.

    The known options for the forth part are:

    • float, indicates that the field is edited as a decimal number, integer. The first part of the input mask specifies the pattern to be used for grouping and decimal separators, and - if negative numbers are supported. If the first part is empty, the float is formatted as indicated by current regional settings. For instance, "##;;;float" specifies a 2 digit number in float format. The grouping, decimal, negative and digits options are valid if the float option is present.

    • grouping=value, Character used to separate groups of digits to the left of the decimal. Valid only if float is present. For instance ";;;float,grouping=" indicates that no grouping is applied to the decimal number (LOCALE_STHOUSAND)
    • decimal=value, Character used for the decimal separator. Valid only if float is present. For instance ";;;float,grouping= ,decimal=\," indicates that the decimal number uses the space for grouping digits to the left, while for decimal separator the comma character is used (LOCALE_SDECIMAL)
    • negative=value, indicates whether the decimal number supports negative numbers. The value should be 0 or 1. 1 means negative numbers are allowed. Else 0 or missing, the negative numbers are not accepted. Valid only if float is present.
    • digits=value, indicates the max number of fractional digits placed after the decimal separator. Valid only if float is present. For instance, ";;;float,digits=4" indicates a max 4 digits after decimal separator (LOCALE_IDIGITS)
    • password[=value], displays a black circle for any shown character. For instance, ";;;password", specifies that the field to be displayed as a password. If the value parameter is present, the first character in the value indicates the password character to be used. By default, the * password character is used for non-TrueType fonts, else the black circle character is used. For instance, ";;;password=*", specifies that the field to be displayed as a password, and use the * for password character. If the value parameter is missing, the default password character is used.
    • right, aligns the characters to the right. For instance, "(999) 999-9999;;;right" displays and masks a telephone number aligned to the right. readonly, the editor is locked, user can not update the content, the caret is available, so user can copy the text, excepts the password fields.
    • inserttype, indicates that the field enters in insert-type mode, if this is the first option found. If the forth part includes also the overtype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;inserttype,overtype", indicates that the field enter in insert-type mode, and over-type mode is allowed. The "##:##;;0;inserttype", indicates that the field enter in insert-type mode, and over-type mode is not allowed.
    • overtype, indicates that the field enters in over-type mode, if this is the first option found. If the forth part includes also the inserttype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;overtype,inserttype", indicates that the field enter in over-type mode, and insert-type mode is allowed. The "##:##;;0;overtype", indicates that the field enter in over-type mode, and insert-type mode is not allowed.
    • nocontext, indicates that the field provides no context menu when user right clicks the field. For instance, ";;;password,nocontext" displays a password field, where the user can not invoke the default context menu, usually when a right click occurs.
    • beep, indicates whether a beep is played once the user enters an invalid character. For instance, "00:00;;;beep" plays a beep once the user types in invalid character, in this case any character that's not a digit.
    • warning=value, indicates the html message to be shown when the user enters an invalid character. For instance, "00:00:00;;;warning=invalid character" displays a "invalid character" tooltip once the user types in invalid character, in this case any character that's not a digit. The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape )
    • invalid=value, indicates the html message to be displayed when the user enters an inappropriate value for the field. If the value is missing or empty, the option has no effect, so no validation is performed. If the value is a not-empty value, the validation is performed. If the value is single space, no message is displayed and the field is keep opened while the value is inappropriate. For instance, "!(999) 000 0000;;;invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." displays the "The value you entered isn't appropriate for the input mask '...' specified for this field." tooltip once the user leaves the field and it is not-valid ( for instance, the field includes entities required and uncompleted ). The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape ). This option can be combined with empty, validateas.
    • validateas=value, specifies the additional validation is done for the current field. If value is missing or 0 (exValidateAsNone), the option has no effect. The validateas option has effect only if the invalid option specifies a not-empty value. Currently, the value can be 1 (exValidateAsDate), which indicates that the field is validated as a date. For instance, having the mask "!00/00/0000;;0;empty,validateas=1,invalid=Invalid date!,warning=Invalid character!,select=4,overtype", indicates that the field is validate as date ( validateas=1 ).
    • empty, indicates whether the field supports empty values. This option can be used with invalid flag, which indicates that the user can leave the field if it is empty. If empty flag is present, the field displays nothing if no entity is completed ( empty ). Once the user starts typing characters the current mask is displayed. For instance, having the mask "!(999) 000 0000;;;empty,select=4,overtype,invalid=invalid phone number,beep", it specifies an empty or valid phone to be entered.
    • select=value, indicates what to select from the field when it got the focus. The value could be 0 ( nothing, exSelectNoGotFocus ), 1 ( select all, exSelectAllGotFocus ), 2 ( select the first empty and editable entity of the field, exSelectEditableGotFocus ), 3 ( moves the cursor to the beginning of the first empty and editable entity of the field, exMoveEditableGotFocus ), 4 ( select the first empty, required and editable entity of the field, exSelectRequiredEditableGotFocus ), 5 ( moves the cursor to the beginning of the first empty, required and editable entity of the field, exMoveRequiredEditableGotFocus ). For modes 2 and 4 the entire field is selected if no matching entity is found. For instance, "`Time:`XX:XX;;;select=1" indicates that the entire field ( including the Time: prefix ) is selected once it get the focus. The "`Time:`XX:XX;;;select=3", moves the cursor to first X, if empty, the second if empty, and so on

Experimental:
multiline, specifies that the field supports multiple lines.
rich, specifies that the field displays a rich type editor. By default, the standard edit field is shown
disabled, shows as disabled the field.

B) If the EditOption(exEditMaskFloat) property is True, the EditMask is defined such as:

The EditMask property may indicate the followings:
  • negative number: if the first character in the mask is - ( minus ) the control supports negative numbers. Pressing the - key will toggle the sign of the number. The + sign is never displayed.
  • decimal symbol: the last character that's different than # ( digit ), or 0 (zero) indicates the decimal symbol. If it is not present the control mask a floating point number without decimals.
  • thousand symbol: the thousand symbol is the last character that's not a # ( digit ), 0 (zero) or it is not the decimal symbol as explained earlier, if present.
  • the maximum number of decimals in the number ( the # or 0 character after the decimal symbol )
  • the maximum number of digits in the integer part ( the number of # or 0 character before decimal symbol )
  • the 0 character indicates a leading-zero. The count of 0 (zero) characters before decimal character indicates the leading-zero for integer part of the control, while the count of 0 (zero) characters after the decimal separator indicates the leading-zero for decimal part of the control. For instance, the Mask on "-###,###,##0.00", while the control's Text property is 1, the control displays 1.00, if 1.1 if displays 1.10, and if empty, the 0.00 is displayed.

If the EditMask property is empty, the control takes the settings for the regional options like: Decimal Symbol , No. of digits after decimal, Digit grouping symbol.

Here are few samples:

The EditMask"-###.###.##0,00" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator ). This format displays leading-zeros.

The EditMask"-###.###.###,##" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator )

The EditMask"-###,###,###.##" filter floating point numbers a number for English settings ( "." is the decimal sign, "," is the thousands separator )

The EditMask"####" indicates a max-4 digit number ( positive ) without a decimal symbol and without digit grouping

The EditMask"-##.#" filters a floating point number from the -99.9 to 99.9 ( "." is the decimal sign, no thousands separator )

The EditMask"#,###.##" filters a floating point number from the 0 to 9,999.99 with digit grouping ( "." is the decimal sign, "," is the thousands separator ).


property EditOption

property Item.EditOption(Option as EditOptionEnum) as Variant
Specifies different options for item's edit control.

Type | Description
Option as EditOptionEnum | An EditOptionEnum expression that specifies the option to be updated.
Variant | A VARIANT expression that indicates the option's value.
The EditOption property different options for item's edit control. The AllowEdit property associates an editor to the current item. The EditCaption property specifies the value to show in the edit field. The EditWidth property specifies the size/width of the edit field inside the item. The EditBorder property specifies whether the edit shows a border around it. The control fires the EditChange event when the user changes the edit's caption. For instance, the EditOption(exEditSpinStep) property specifies the step to advance when user clicks the editor's spin.

How can I assign a slider field to the item (method 2)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Slider")
            .AllowEdit = 3
            .EditWidth = -128
            .EditValue = 25
        End With
        With .Add("Slider")
            .AllowEdit = 3
            .EditBorder = 0
            .EditWidth = -128
            .EditOption(1) = 50
            .EditOption(2) = 450
            .EditOption(3) = 2
            .EditOption(4) = 50
            .EditOption(5) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" & _
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
            .EditValue = 345
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Slider")
            .AllowEdit = exItemEditSlider
            .EditWidth = -128
            .EditValue = 25
        End With
        With .Add("Slider")
            .AllowEdit = exItemEditSlider
            .EditBorder = exEditBorderNone
            .EditWidth = -128
            .EditOption(exEditMinValue) = 50
            .EditOption(exEditMaxValue) = 450
            .EditOption(exEditTickStyle) = 2
            .EditOption(exEditTickFrequency) = 50
            .EditOption(exEditTickLabel) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" & _
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
            .EditValue = 345
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Slider")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditWidth = -128
            .EditValue = 25
        End With
        With .Add("Slider")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditWidth = -128
            .set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditMinValue,50)
            .set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditMaxValue,450)
            .set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditTickStyle,2)
            .set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditTickFrequency,50)
            .set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditTickLabel,"value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" & _
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )")
            .EditValue = 345
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Slider")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditWidth = -128
            .EditValue = 25
        End With
        With .Add("Slider")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditWidth = -128
            .EditOption(EXTOOLBARLib.EditOptionEnum.exEditMinValue) = 50
            .EditOption(EXTOOLBARLib.EditOptionEnum.exEditMaxValue) = 450
            .EditOption(EXTOOLBARLib.EditOptionEnum.exEditTickStyle) = 2
            .EditOption(EXTOOLBARLib.EditOptionEnum.exEditTickFrequency) = 50
            .EditOption(EXTOOLBARLib.EditOptionEnum.exEditTickLabel) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" & _
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
            .EditValue = 345
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Slider",vtMissing,vtMissing);
        var_Item->PutAllowEdit(EXTOOLBARLib::exItemEditSlider);
        var_Item->PutEditWidth(-128);
        var_Item->PutEditValue(long(25));
    EXTOOLBARLib::IItemPtr var_Item1 = var_Items->Add(L"Slider",vtMissing,vtMissing);
        var_Item1->PutAllowEdit(EXTOOLBARLib::exItemEditSlider);
        var_Item1->PutEditBorder(EXTOOLBARLib::exEditBorderNone);
        var_Item1->PutEditWidth(-128);
        var_Item1->PutEditOption(EXTOOLBARLib::exEditMinValue,long(50));
        var_Item1->PutEditOption(EXTOOLBARLib::exEditMaxValue,long(450));
        var_Item1->PutEditOption(EXTOOLBARLib::exEditTickStyle,long(2));
        var_Item1->PutEditOption(EXTOOLBARLib::exEditTickFrequency,long(50));
        var_Item1->PutEditOption(EXTOOLBARLib::exEditTickLabel,_bstr_t("value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =") +
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )");
        var_Item1->PutEditValue(long(345));
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Slider",TNoParam(),TNoParam());
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditSlider;
        var_Item->EditWidth = -128;
        var_Item->set_EditValue(TVariant(25));
    Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items->Add(L"Slider",TNoParam(),TNoParam());
        var_Item1->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditSlider;
        var_Item1->EditBorder = Extoolbarlib_tlb::EditBorderEnum::exEditBorderNone;
        var_Item1->EditWidth = -128;
        var_Item1->set_EditOption(Extoolbarlib_tlb::EditOptionEnum::exEditMinValue,TVariant(50));
        var_Item1->set_EditOption(Extoolbarlib_tlb::EditOptionEnum::exEditMaxValue,TVariant(450));
        var_Item1->set_EditOption(Extoolbarlib_tlb::EditOptionEnum::exEditTickStyle,TVariant(2));
        var_Item1->set_EditOption(Extoolbarlib_tlb::EditOptionEnum::exEditTickFrequency,TVariant(50));
        var_Item1->set_EditOption(Extoolbarlib_tlb::EditOptionEnum::exEditTickLabel,TVariant(String("value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =") +
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"));
        var_Item1->set_EditValue(TVariant(345));
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Slider",null,null);
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item.EditWidth = -128;
        var_Item.EditValue = 25;
    exontrol.EXTOOLBARLib.Item var_Item1 = var_Items.Add("Slider",null,null);
        var_Item1.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item1.EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item1.EditWidth = -128;
        var_Item1.set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditMinValue,50);
        var_Item1.set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditMaxValue,450);
        var_Item1.set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditTickStyle,2);
        var_Item1.set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditTickFrequency,50);
        var_Item1.set_EditOption(exontrol.EXTOOLBARLib.EditOptionEnum.exEditTickLabel,"value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" +
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )");
        var_Item1.EditValue = 345;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Slider",null,null);
            var_Item.AllowEdit = 3;
            var_Item.EditWidth = -128;
            var_Item.EditValue = 25;
        var var_Item1 = var_Items.Add("Slider",null,null);
            var_Item1.AllowEdit = 3;
            var_Item1.EditBorder = 0;
            var_Item1.EditWidth = -128;
            var_Item1.EditOption(1) = 50;
            var_Item1.EditOption(2) = 450;
            var_Item1.EditOption(3) = 2;
            var_Item1.EditOption(4) = 50;
            var_Item1.EditOption(5) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" +
    " 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )";
            var_Item1.EditValue = 345;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Slider")
                .AllowEdit = 3
                .EditWidth = -128
                .EditValue = 25
            End With
            With .Add("Slider")
                .AllowEdit = 3
                .EditBorder = 0
                .EditWidth = -128
                .EditOption(1) = 50
                .EditOption(2) = 450
                .EditOption(3) = 2
                .EditOption(4) = 50
                .EditOption(5) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" & _
    " 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
                .EditValue = 345
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Slider",null,null);
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item.EditWidth = -128;
        var_Item.EditValue = 25;
    EXTOOLBARLib.Item var_Item1 = var_Items.Add("Slider",null,null);
        var_Item1.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item1.EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item1.EditWidth = -128;
        var_Item1.set_EditOption(EXTOOLBARLib.EditOptionEnum.exEditMinValue,50);
        var_Item1.set_EditOption(EXTOOLBARLib.EditOptionEnum.exEditMaxValue,450);
        var_Item1.set_EditOption(EXTOOLBARLib.EditOptionEnum.exEditTickStyle,2);
        var_Item1.set_EditOption(EXTOOLBARLib.EditOptionEnum.exEditTickFrequency,50);
        var_Item1.set_EditOption(EXTOOLBARLib.EditOptionEnum.exEditTickLabel,"value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value =" +
" 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )");
        var_Item1.EditValue = 345;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items;
    anytype var_Item,var_Item1,var_Items;
    str var_s;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Slider"); com_Item = var_Item;
            com_Item.AllowEdit(3/*exItemEditSlider*/);
            com_Item.EditWidth(-128);
            com_Item.EditValue(COMVariant::createFromInt(25));
        var_Item1 = com_Items.Add("Slider"); com_Item1 = var_Item1;
            com_Item1.AllowEdit(3/*exItemEditSlider*/);
            com_Item1.EditBorder(0/*exEditBorderNone*/);
            com_Item1.EditWidth(-128);
            com_Item1.EditOption(1/*exEditMinValue*/,COMVariant::createFromInt(50));
            com_Item1.EditOption(2/*exEditMaxValue*/,COMVariant::createFromInt(450));
            com_Item1.EditOption(3/*exEditTickStyle*/,COMVariant::createFromInt(2));
            com_Item1.EditOption(4/*exEditTickFrequency*/,COMVariant::createFromInt(50));
            var_s = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = ";
            var_s = var_s + "200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )";
            com_Item1.EditOption(5/*exEditTickLabel*/,COMVariant::createFromStr(var_s));
            com_Item1.EditValue(COMVariant::createFromInt(345));
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Slider',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
            EditWidth := -128;
            EditValue := TObject(25);
        end;
        with Add('Slider',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
            EditBorder := EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
            EditWidth := -128;
            EditOption[EXTOOLBARLib.EditOptionEnum.exEditMinValue] := TObject(50);
            EditOption[EXTOOLBARLib.EditOptionEnum.exEditMaxValue] := TObject(450);
            EditOption[EXTOOLBARLib.EditOptionEnum.exEditTickStyle] := TObject(2);
            EditOption[EXTOOLBARLib.EditOptionEnum.exEditTickFrequency] := TObject(50);
            EditOption[EXTOOLBARLib.EditOptionEnum.exEditTickLabel] := 'value = vmin ? ''<br><font ;6><b>''+value : ( value = vmax ? ''<br><font ;6><b>''+value : ( value = ' +
    '200 ? ''<br><font ;6><b><fgcolor FF0000>''+value : '''' ) )';
            EditValue := TObject(345);
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Slider',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditSlider;
            EditWidth := -128;
            EditValue := OleVariant(25);
        end;
        with Add('Slider',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditSlider;
            EditBorder := EXTOOLBARLib_TLB.exEditBorderNone;
            EditWidth := -128;
            EditOption[EXTOOLBARLib_TLB.exEditMinValue] := OleVariant(50);
            EditOption[EXTOOLBARLib_TLB.exEditMaxValue] := OleVariant(450);
            EditOption[EXTOOLBARLib_TLB.exEditTickStyle] := OleVariant(2);
            EditOption[EXTOOLBARLib_TLB.exEditTickFrequency] := OleVariant(50);
            EditOption[EXTOOLBARLib_TLB.exEditTickLabel] := 'value = vmin ? ''<br><font ;6><b>''+value : ( value = vmax ? ''<br><font ;6><b>''+value : ( value = ' +
    '200 ? ''<br><font ;6><b><fgcolor FF0000>''+value : '''' ) )';
            EditValue := OleVariant(345);
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Slider")
            .AllowEdit = 3
            .EditWidth = -128
            .EditValue = 25
        endwith
        with .Add("Slider")
            .AllowEdit = 3
            .EditBorder = 0
            .EditWidth = -128
            .EditOption(1) = 50
            .EditOption(2) = 450
            .EditOption(3) = 2
            .EditOption(4) = 50
            var_s = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = "
            var_s = var_s + "200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
            .EditOption(5) = var_s
            .EditValue = 345
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Slider")
        var_Item.AllowEdit = 3
        var_Item.EditWidth = -128
        var_Item.EditValue = 25
    var_Item1 = var_Items.Add("Slider")
        var_Item1.AllowEdit = 3
        var_Item1.EditBorder = 0
        var_Item1.EditWidth = -128
        // var_Item1.EditOption(1) = 50
        with (oToolBar)
            TemplateDef = [Dim var_Item1]
            TemplateDef = var_Item1
            Template = [var_Item1.EditOption(1) = 50]
        endwith
        // var_Item1.EditOption(2) = 450
        with (oToolBar)
            TemplateDef = [Dim var_Item1]
            TemplateDef = var_Item1
            Template = [var_Item1.EditOption(2) = 450]
        endwith
        // var_Item1.EditOption(3) = 2
        with (oToolBar)
            TemplateDef = [Dim var_Item1]
            TemplateDef = var_Item1
            Template = [var_Item1.EditOption(3) = 2]
        endwith
        // var_Item1.EditOption(4) = 50
        with (oToolBar)
            TemplateDef = [Dim var_Item1]
            TemplateDef = var_Item1
            Template = [var_Item1.EditOption(4) = 50]
        endwith
        // var_Item1.EditOption(5) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
        with (oToolBar)
            TemplateDef = [Dim var_Item1]
            TemplateDef = var_Item1
            Template = [var_Item1.EditOption(5) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"]
        endwith
        var_Item1.EditValue = 345
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Slider")
        var_Item.AllowEdit = 3
        var_Item.EditWidth = -128
        var_Item.EditValue = 25
    var_Item1 = var_Items.Add("Slider")
        var_Item1.AllowEdit = 3
        var_Item1.EditBorder = 0
        var_Item1.EditWidth = -128
        ' var_Item1.EditOption(1) = 50
        oToolBar.TemplateDef = "Dim var_Item1"
        oToolBar.TemplateDef = var_Item1
        oToolBar.Template = "var_Item1.EditOption(1) = 50"

        ' var_Item1.EditOption(2) = 450
        oToolBar.TemplateDef = "Dim var_Item1"
        oToolBar.TemplateDef = var_Item1
        oToolBar.Template = "var_Item1.EditOption(2) = 450"

        ' var_Item1.EditOption(3) = 2
        oToolBar.TemplateDef = "Dim var_Item1"
        oToolBar.TemplateDef = var_Item1
        oToolBar.Template = "var_Item1.EditOption(3) = 2"

        ' var_Item1.EditOption(4) = 50
        oToolBar.TemplateDef = "Dim var_Item1"
        oToolBar.TemplateDef = var_Item1
        oToolBar.Template = "var_Item1.EditOption(4) = 50"

        ' var_Item1.EditOption(5) = "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
        oToolBar.TemplateDef = "Dim var_Item1"
        oToolBar.TemplateDef = var_Item1
        oToolBar.Template = "var_Item1.EditOption(5) = \"value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )\""

        var_Item1.EditValue = 345
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1 as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Slider",nil,nil)
        var_Item:AllowEdit := exItemEditSlider
        var_Item:EditWidth := -128
        var_Item:EditValue := 25
    var_Item1 := var_Items:Add("Slider",nil,nil)
        var_Item1:AllowEdit := exItemEditSlider
        var_Item1:EditBorder := exEditBorderNone
        var_Item1:EditWidth := -128
        var_Item1:[EditOption,exEditMinValue] := 50
        var_Item1:[EditOption,exEditMaxValue] := 450
        var_Item1:[EditOption,exEditTickStyle] := 2
        var_Item1:[EditOption,exEditTickFrequency] := 50
        var_Item1:[EditOption,exEditTickLabel] := "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
        var_Item1:EditValue := 345
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Slider")
        var_Item.AllowEdit = 3
        var_Item.EditWidth = -128
        var_Item.EditValue = 25
    var_Item1 = var_Items.Add("Slider")
        var_Item1.AllowEdit = 3
        var_Item1.EditBorder = 0
        var_Item1.EditWidth = -128
        var_Item1.EditOption(1,50)
        var_Item1.EditOption(2,450)
        var_Item1.EditOption(3,2)
        var_Item1.EditOption(4,50)
        var_Item1.EditOption(5,"value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )")
        var_Item1.EditValue = 345
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Slider" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAllowEdit of hoItem to OLEexItemEditSlider
            Set ComEditWidth of hoItem to -128
            Set ComEditValue of hoItem to 25
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Slider" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComAllowEdit of hoItem1 to OLEexItemEditSlider
            Set ComEditBorder of hoItem1 to OLEexEditBorderNone
            Set ComEditWidth of hoItem1 to -128
            Set ComEditOption of hoItem1 OLEexEditMinValue to 50
            Set ComEditOption of hoItem1 OLEexEditMaxValue to 450
            Set ComEditOption of hoItem1 OLEexEditTickStyle to 2
            Set ComEditOption of hoItem1 OLEexEditTickFrequency to 50
            Set ComEditOption of hoItem1 OLEexEditTickLabel to "value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )"
            Set ComEditValue of hoItem1 to 345
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Slider")
                oItem:AllowEdit := 3/*exItemEditSlider*/
                oItem:EditWidth := -128
                oItem:EditValue := 25
            oItem1 := oItems:Add("Slider")
                oItem1:AllowEdit := 3/*exItemEditSlider*/
                oItem1:EditBorder := 0/*exEditBorderNone*/
                oItem1:EditWidth := -128
                oItem1:SetProperty("EditOption",1/*exEditMinValue*/,50)
                oItem1:SetProperty("EditOption",2/*exEditMaxValue*/,450)
                oItem1:SetProperty("EditOption",3/*exEditTickStyle*/,2)
                oItem1:SetProperty("EditOption",4/*exEditTickFrequency*/,50)
                oItem1:SetProperty("EditOption",5/*exEditTickLabel*/,"value = vmin ? '<br><font ;6><b>'+value : ( value = vmax ? '<br><font ;6><b>'+value : ( value = 200 ? '<br><font ;6><b><fgcolor FF0000>'+value : '' ) )")
                oItem1:EditValue := 345
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property EditValue

property Item.EditValue as Variant
Specifies the edit's value when the item contains an edit control.

Type | Description
Variant | A VARIANT expression that specifies the edit's value.
The EditValue/EditCaption property specifies the caption to be shown on the item's edit text box. Use the AllowEdit property to add a text-box inside the item, so the user can type any characters inside. The EditWidth property specifies the width of the text-box inside the item. The EditBorder property specifies the border to be shown around the item's text box. You can use the Get method to collect all items of Edit type. The EditChange event notifies your application once the user alters the item's text-box caption.

The EditValue property indicates the edit's value as shown bellow:

  • The EditValue property specifies the value of the edit field ( string expression ), without the masking characters, when AllowEdit property includes the exItemEditMask flag.
  • The EditValue property indicates the current slider position/value ( long expression ), when AllowEdit property includes the exItemEditSlider, exItemEditProgress, exItemEditScrollBar, or exItemEditColor flag.

How can I assign a color field to the item (method 2)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Color")
            .AllowEdit = 6
            .EditBorder = 0
            .EditWidth = -128
            .EditValue = 255
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Color")
            .AllowEdit = exItemEditColor
            .EditBorder = exEditBorderNone
            .EditWidth = -128
            .EditValue = 255
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Color")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditColor
            .EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditWidth = -128
            .EditValue = 255
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Color")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditColor
            .EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditWidth = -128
            .EditValue = 255
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Color",vtMissing,vtMissing);
        var_Item->PutAllowEdit(EXTOOLBARLib::exItemEditColor);
        var_Item->PutEditBorder(EXTOOLBARLib::exEditBorderNone);
        var_Item->PutEditWidth(-128);
        var_Item->PutEditValue(long(255));
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Color",TNoParam(),TNoParam());
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditColor;
        var_Item->EditBorder = Extoolbarlib_tlb::EditBorderEnum::exEditBorderNone;
        var_Item->EditWidth = -128;
        var_Item->set_EditValue(TVariant(255));
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Color",null,null);
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditColor;
        var_Item.EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item.EditWidth = -128;
        var_Item.EditValue = 255;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Color",null,null);
            var_Item.AllowEdit = 6;
            var_Item.EditBorder = 0;
            var_Item.EditWidth = -128;
            var_Item.EditValue = 255;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Color")
                .AllowEdit = 6
                .EditBorder = 0
                .EditWidth = -128
                .EditValue = 255
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Color",null,null);
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditColor;
        var_Item.EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item.EditWidth = -128;
        var_Item.EditValue = 255;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Color"); com_Item = var_Item;
            com_Item.AllowEdit(6/*exItemEditColor*/);
            com_Item.EditBorder(0/*exEditBorderNone*/);
            com_Item.EditWidth(-128);
            com_Item.EditValue(COMVariant::createFromInt(255));
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Color',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditColor;
            EditBorder := EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
            EditWidth := -128;
            EditValue := TObject(255);
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Color',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditColor;
            EditBorder := EXTOOLBARLib_TLB.exEditBorderNone;
            EditWidth := -128;
            EditValue := OleVariant(255);
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Color")
            .AllowEdit = 6
            .EditBorder = 0
            .EditWidth = -128
            .EditValue = 255
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Color")
        var_Item.AllowEdit = 6
        var_Item.EditBorder = 0
        var_Item.EditWidth = -128
        var_Item.EditValue = 255
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Color")
        var_Item.AllowEdit = 6
        var_Item.EditBorder = 0
        var_Item.EditWidth = -128
        var_Item.EditValue = 255
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Color",nil,nil)
        var_Item:AllowEdit := exItemEditColor
        var_Item:EditBorder := exEditBorderNone
        var_Item:EditWidth := -128
        var_Item:EditValue := 255
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Color")
        var_Item.AllowEdit = 6
        var_Item.EditBorder = 0
        var_Item.EditWidth = -128
        var_Item.EditValue = 255
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Color" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAllowEdit of hoItem to OLEexItemEditColor
            Set ComEditBorder of hoItem to OLEexEditBorderNone
            Set ComEditWidth of hoItem to -128
            Set ComEditValue of hoItem to 255
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Color")
                oItem:AllowEdit := 6/*exItemEditColor*/
                oItem:EditBorder := 0/*exEditBorderNone*/
                oItem:EditWidth := -128
                oItem:EditValue := 255
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property EditWidth

property Item.EditWidth as Long
Specifies the width for the inside edit control.

Type | Description
Long | A Long expression that specifies the width of the item's text box.
The EditWidth property specifies the width of the text-box inside the item. The EditBorder property specifies the border to be shown around the item's text box. The EditCaption property specifies the caption to be shown on the item's Edit text box. Use the AllowEdit property to add a text-box inside the item, so the user can type any characters inside. You can use the Get method to collect all items of Edit type. The EditChange event notifies your application once the user alters the item's text-box caption.

How can I specify the width of the item's editor?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Mask")
            .AllowEdit = 1
            .EditValue = "this is a text"
            .EditWidth = -128
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Mask")
            .AllowEdit = exItemEditText
            .EditValue = "this is a text"
            .EditWidth = -128
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Mask")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditText
            .EditValue = "this is a text"
            .EditWidth = -128
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Mask")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditText
            .EditValue = "this is a text"
            .EditWidth = -128
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Mask",vtMissing,vtMissing);
        var_Item->PutAllowEdit(EXTOOLBARLib::exItemEditText);
        var_Item->PutEditValue("this is a text");
        var_Item->PutEditWidth(-128);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Mask",TNoParam(),TNoParam());
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditText;
        var_Item->set_EditValue(TVariant("this is a text"));
        var_Item->EditWidth = -128;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Mask",null,null);
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditText;
        var_Item.EditValue = "this is a text";
        var_Item.EditWidth = -128;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Mask",null,null);
            var_Item.AllowEdit = 1;
            var_Item.EditValue = "this is a text";
            var_Item.EditWidth = -128;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Mask")
                .AllowEdit = 1
                .EditValue = "this is a text"
                .EditWidth = -128
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Mask",null,null);
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditText;
        var_Item.EditValue = "this is a text";
        var_Item.EditWidth = -128;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Mask"); com_Item = var_Item;
            com_Item.AllowEdit(1/*exItemEditText*/);
            com_Item.EditValue("this is a text");
            com_Item.EditWidth(-128);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Mask',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditText;
            EditValue := 'this is a text';
            EditWidth := -128;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Mask',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditText;
            EditValue := 'this is a text';
            EditWidth := -128;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Mask")
            .AllowEdit = 1
            .EditValue = "this is a text"
            .EditWidth = -128
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Mask")
        var_Item.AllowEdit = 1
        var_Item.EditValue = "this is a text"
        var_Item.EditWidth = -128
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Mask")
        var_Item.AllowEdit = 1
        var_Item.EditValue = "this is a text"
        var_Item.EditWidth = -128
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Mask",nil,nil)
        var_Item:AllowEdit := exItemEditText
        var_Item:EditValue := "this is a text"
        var_Item:EditWidth := -128
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Mask")
        var_Item.AllowEdit = 1
        var_Item.EditValue = "this is a text"
        var_Item.EditWidth = -128
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Mask" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAllowEdit of hoItem to OLEexItemEditText
            Set ComEditValue of hoItem to "this is a text"
            Set ComEditWidth of hoItem to -128
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Mask")
                oItem:AllowEdit := 1/*exItemEditText*/
                oItem:EditValue := "this is a text"
                oItem:EditWidth := -128
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Enabled

property Item.Enabled as Boolean
Retrieves or sets a value that indicates whether the item is enabled or disabled.

Type | Description
Boolean | A Boolean expression that specifies whether the item is enabled or disabled.
By default, the Enabled property is True. Use the Enabled property to disable an item. A disabled item ( Enabled property is False) shows as grayed, and it is un-selectable, so the user can select or highlight it. An item ( Enabled property is True, ShowAsDisabled property is True ), shows as grayed, but it is selectable, so the user can select or highlight it. You can use the Visible property to show or hide the item. The Remove method removes an individual Item object giving its identifier or caption. Use the ShowAsDisabled property to show the item as disabled, while it is enabled.

How can I enable or disable an item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutEnabled(VARIANT_FALSE);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[dis]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Enabled = false;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[dis]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Enabled = false;
    var_Items.Add("",null,null).ToString = "Item[dis]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Enabled = false;
        var_Items.Add("",null,null).ToString = "Item[dis]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Enabled = False
            .Add("").ToString = "Item[dis]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Enabled = false;
    var_Items.Add("",null,null).ToString = "Item[dis]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Enabled(false);
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[dis]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Enabled := False;
        Add('',Nil,Nil).ToString := 'Item[dis]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Enabled := False;
        Add('',Null,Null).ToString := 'Item[dis]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").Enabled = .F.
        .Add("").ToString = "Item[dis]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Enabled = false
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Enabled = false]
    endwith
    // var_Items.Add("").ToString = "Item[dis]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[dis]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Enabled = .f.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Enabled = False"

    ' var_Items.Add("").ToString = "Item[dis]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[dis]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Enabled := false
    var_Items:Add("",nil,nil):ToString := "Item[dis]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Enabled = false
    var_Items.Add("").ToString = "Item[dis]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComEnabled of hoItem to False
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[dis]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):Enabled := .F.
            oItems:Add(""):ToString := "Item[dis]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ForeColor

property Item.ForeColor as Color
Specifies the item's foreground color of the item.

Type | Description
Color | A Color expression that specifies the item's foreground color.
The ForeColor property specifies the item's foreground color. The BackColor property specifies a different background color or a visual appearance for the item. The Caption property indicates the item's caption to be shown on the item. You can use the <fgcolor> HTML tag in the Caption property to specify a different foreground color for parts of the caption. The SelForeColor property specifies the item's foreground color when it is selected or highlighted.

How can I change the item's foreground color?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").ForeColor = RGB(255,0,0)
        .Add "<fgcolor FF0000>Item"
        .Add("").ToString = "Item[fg=RGB(255,0,0)]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").ForeColor = RGB(255,0,0)
        .Add "<fgcolor FF0000>Item"
        .Add("").ToString = "Item[fg=RGB(255,0,0)]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").ForeColor = Color.FromArgb(255,0,0)
        .Add("<fgcolor FF0000>Item")
        .Add("").ToString = "Item[fg=RGB(255,0,0)]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").ForeColor = RGB(255,0,0)
        .Add("<fgcolor FF0000>Item")
        .Add("").ToString = "Item[fg=RGB(255,0,0)]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutForeColor(RGB(255,0,0));
    var_Items->Add(L"<fgcolor FF0000>Item",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[fg=RGB(255,0,0)]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->ForeColor = RGB(255,0,0);
    var_Items->Add(L"<fgcolor FF0000>Item",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[fg=RGB(255,0,0)]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).ForeColor = Color.FromArgb(255,0,0);
    var_Items.Add("<fgcolor FF0000>Item",null,null);
    var_Items.Add("",null,null).ToString = "Item[fg=RGB(255,0,0)]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).ForeColor = 255;
        var_Items.Add("<fgcolor FF0000>Item",null,null);
        var_Items.Add("",null,null).ToString = "Item[fg=RGB(255,0,0)]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").ForeColor = RGB(255,0,0)
            .Add "<fgcolor FF0000>Item"
            .Add("").ToString = "Item[fg=RGB(255,0,0)]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).ForeColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
    var_Items.Add("<fgcolor FF0000>Item",null,null);
    var_Items.Add("",null,null).ToString = "Item[fg=RGB(255,0,0)]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.ForeColor(WinApi::RGB2int(255,0,0));
        com_Items.Add("<fgcolor FF0000>Item");
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[fg=RGB(255,0,0)]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).ForeColor := $ff;
        Add('<fgcolor FF0000>Item',Nil,Nil);
        Add('',Nil,Nil).ToString := 'Item[fg=RGB(255,0,0)]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).ForeColor := $ff;
        Add('<fgcolor FF0000>Item',Null,Null);
        Add('',Null,Null).ToString := 'Item[fg=RGB(255,0,0)]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").ForeColor = RGB(255,0,0)
        .Add("<fgcolor FF0000>Item")
        .Add("").ToString = "Item[fg=RGB(255,0,0)]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").ForeColor = 0xff
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.ForeColor = 0xff]
    endwith
    var_Items.Add("<fgcolor FF0000>Item")
    // var_Items.Add("").ToString = "Item[fg=RGB(255,0,0)]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[fg=RGB(255,0,0)]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").ForeColor = 255
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.ForeColor = 255"

    var_Items.Add("<fgcolor FF0000>Item")
    ' var_Items.Add("").ToString = "Item[fg=RGB(255,0,0)]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[fg=RGB(255,0,0)]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):ForeColor := RGB(255,0,0)
    var_Items:Add("<fgcolor FF0000>Item",nil,nil)
    var_Items:Add("",nil,nil):ToString := "Item[fg=RGB(255,0,0)]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").ForeColor = RGB(255,0,0)
    var_Items.Add("<fgcolor FF0000>Item")
    var_Items.Add("").ToString = "Item[fg=RGB(255,0,0)]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComForeColor of hoItem to (RGB(255,0,0))
        Send Destroy to hoItem
        Get ComAdd of hoItems "<fgcolor FF0000>Item" Nothing Nothing to Nothing
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[fg=RGB(255,0,0)]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
            oItems:Add("<fgcolor FF0000>Item")
            oItems:Add(""):ToString := "Item[fg=RGB(255,0,0)]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ForegroundExt

property Item.ForegroundExt as String
Indicates additional colors, text, images that can be displayed on the item's foreground using the EBN string format.

Type | Description
String | A String expression ( "EBN String Format" ) that defines the layout of the UI to be applied on the items' background. The syntax of EBN String Format in BNF notation is shown bellow. You can use the EBN's Builder of eXButton/COM control to define visually the EBN String Format.
By default, the ForegroundExt property is empty. Using the ForegroundExt property you have unlimited options to show any HTML text, images, colors, EBNs, patterns, frames anywhere on the item's foreground. For instance, let's say you need to display more colors on the item's foreground, or just want to display an additional caption or image to a specified location on the item's foreground. The EBN String Format defines the parts of the EBN to be applied on the item's foreground. The EBN is a set of UI elements that are built as a tree where each element is anchored to its parent element. The BackgroundExt property is shown on the item's background, while the ForegroundExt property is shown on the item's foreground. Using the BackgroundExt property you have unlimited options to show any HTML text, images, colors, EBNs, patterns, frames anywhere on the items' background.

Easy samples:

  • "[pattern=6]", shows the BDiagonal pattern on the object's background.

  • "[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.

  • "[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.

  • "[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:

  • "top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.

  • "[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.

  • "[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.

  • "left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.

  • "bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.

  • "root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side

The Exontrol's eXButton WYSWYG Builder helps you to generate or view the EBN String Format, in the To String field as shown in the following screen shot:

The To String field of the EBN Builder defines the EBN String Format that can be used on BodyBackgroundExt property.

The EBN String Format syntax in BNF notation is defined like follows:

<EBN> ::= <elements> | <root> "(" [<elements>] ")"
<elements> ::= <element> [ "," <elements> ]
<root> ::= "root" [ <attributes> ] | [ <attributes> ]
<element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ]
<anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom"
<attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]"
<client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression>
<expression> ::= <number> | <number> "%"
<attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others>
<equal> ::= "="
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<decimal> ::= <digit><decimal>
<hexadigit> ::= <digit> | "A" | "B"  "C" | "D" | "E"  "F"
<hexa> ::= <hexadigit><hexa>
<number> ::= <decimal> | "0x" <hexa>
<color> ::= <rgbcolor> | number
<rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")"
<string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> "
<characters> ::= <char>|<characters>
<char> ::= <any_character_excepts_null>
<backcolor> ::= "back" <equal> <color>
<text> ::= "text" <equal> <string>
<align> ::= "align" <equal> <number>
<pattern> ::= "pattern" <equal> <number>
<patterncolor> ::= "patterncolor" <equal> <color>
<frame> ::= "frame" <equal> <color>
<data> ::= "data" <equal> <number> | <string>
<framethick> ::= "framethick"
<wordwrap> ::= "wordwrap"

Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.


property GroupPopup

property Item.GroupPopup as GroupPopupEnum
Specifies whether the items of the sub-menu are grouped and displayed on the current item.

Type | Description
GroupPopupEnum | A GroupPopupEnum expression that specifies whether the items of the sub-menu are grouped and displayed on the current item.
By default, the GroupPopup property is exNoGroupPopup, which indicates that the sub-menu is not shown as grouped. Use the GroupPopup property to show the item's sub-menu as a group in the current item. The SubMenu property indicates the item's sub-menu. The GroupPopup has no effect if the item has no sub-items.

The following screen shot shows the items with no grouping:

The following screen shot shows the items with grouping ( horizontally ):

The following screen shot shows different type of items grouped horizontally, vertically:

How can I add new items arranged horizontally to the toolbar control (method 2)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            With .Items
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            With .Items
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            With .Items
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            With .Items
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var var_Items1 = var_Item.Items;
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
            var_Item.GroupPopup = 3;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                With .Items
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items,com_Items1;
    anytype var_Item,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            with Items do
            begin
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            with Items do
            begin
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            with .Items
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Items1 = var_Item.Items
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Items1 = var_Item.Items
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Items1 := var_Item:Items
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Items1 = var_Item.Items
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItems1 := oItem:Items()
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property HotBackColor

property Item.HotBackColor as Color
Specifies the hot background color of the item ( when the cursor hovers the item ).

Type | Description
Color | A Color expression that specifies the item's background color, when the cursor hovers it. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The HotBackColor property specifies a different background color or a visual appearance for the item, when the cursor hovers it. The BackColor property specifies the item's background color of the item. The SelBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked. The Caption property indicates the item's caption to be shown on the item. You can use the <bgcolor> HTML tag in the Caption property to specify a different background color for parts of the caption. The SelHotBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked, and the cursor hovers it.

How can I change the item's background/backcolor, when the cursor hovers it (hot)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").HotBackColor = RGB(255,0,0)
        .Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").HotBackColor = RGB(255,0,0)
        .Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").HotBackColor = Color.FromArgb(255,0,0)
        .Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").HotBackColor = RGB(255,0,0)
        .Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutHotBackColor(RGB(255,0,0));
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[bghot=RGB(255,0,0)]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->HotBackColor = RGB(255,0,0);
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[bghot=RGB(255,0,0)]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).HotBackColor = Color.FromArgb(255,0,0);
    var_Items.Add("",null,null).ToString = "Item[bghot=RGB(255,0,0)]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).HotBackColor = 255;
        var_Items.Add("",null,null).ToString = "Item[bghot=RGB(255,0,0)]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").HotBackColor = RGB(255,0,0)
            .Add("").ToString = "Item[bghot=RGB(255,0,0)]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).HotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
    var_Items.Add("",null,null).ToString = "Item[bghot=RGB(255,0,0)]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.HotBackColor(WinApi::RGB2int(255,0,0));
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[bghot=RGB(255,0,0)]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).HotBackColor := $ff;
        Add('',Nil,Nil).ToString := 'Item[bghot=RGB(255,0,0)]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).HotBackColor := $ff;
        Add('',Null,Null).ToString := 'Item[bghot=RGB(255,0,0)]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").HotBackColor = RGB(255,0,0)
        .Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").HotBackColor = 0xff
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.HotBackColor = 0xff]
    endwith
    // var_Items.Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[bghot=RGB(255,0,0)]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").HotBackColor = 255
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.HotBackColor = 255"

    ' var_Items.Add("").ToString = "Item[bghot=RGB(255,0,0)]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[bghot=RGB(255,0,0)]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):HotBackColor := RGB(255,0,0)
    var_Items:Add("",nil,nil):ToString := "Item[bghot=RGB(255,0,0)]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").HotBackColor = RGB(255,0,0)
    var_Items.Add("").ToString = "Item[bghot=RGB(255,0,0)]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComHotBackColor of hoItem to (RGB(255,0,0))
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[bghot=RGB(255,0,0)]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
            oItems:Add(""):ToString := "Item[bghot=RGB(255,0,0)]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property HTMLImage

property Item.HTMLImage as String
Retrieves or sets a value that indicates the key of the image (HTMLPicture method) to be displayed on the item ( left side ).

Type | Description
String | A String expression that indicates the key of the picture to be displayed on the left side of the caption.
The HTMLImage property assigns a picture to the left side of the caption. The key of the picture to be displayed must be loaded previously using the HTMLPicture property. The HTMLImage property has effect only if the Image property is -1 ( by default ). Use the Image property to assign an icon from the Images collection to the left side of the caption. Use the PopupFlatImageWidth property to specify the width of the column that displays icons/images/check or radio buttons.

The following VFP samples loads the picture using the HTMLPicture method, and displays it on the left side of the caption using the HTMLImage property.

toolbar = CreateObject("Exontrol.ToolBar")
with toolbar
.HTMLPicture("pic1") = "C:\exontrol\images\colorize.gif"
.Items.ToString = "Item A[himg=pic1]"
endwith

or:

toolbar = CreateObject("Exontrol.ToolBar")
with toolbar
.HTMLPicture("pic1") = "C:\exontrol\images\colorize.gif"
.Items.Add("Item A").HTMLImage = "pic1"
 endwith

These two samples are equivalent.


property ID

property Item.ID as Long
Retrieves or sets a value that specifies the item's identifier.

Type | Description
Long | A Long expression that defines the item's identifier. This property can be specified at adding time, by using the ID parameter of the Add method.
Use the ID property to associate an unique identifier to each item. You can use the Item property of the ToolBar component to get the Item object based on its identifier. Use the Debug property to display the identifiers for all visible items, for debugging purposes. The First number in the [] parenthesis indicates the item's ID property. Use the Caption property to specify the item's caption. Use the UserData property to associate any extra data to your items.

How can I specify/assign the item's identifier?

VBA (MS Access, Excell...)

With ToolBar1
    .Debug = True
    With .Items
        .Add "ID 1",0,1000
        .Add("ID 2").ID = 1001
        .Add("").ToString = "ID 3[id=1002]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    .Debug = True
    With .Items
        .Add "ID 1",0,1000
        .Add("ID 2").ID = 1001
        .Add("").ToString = "ID 3[id=1002]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .Debug = True
    With .Items
        .Add("ID 1",0,1000)
        .Add("ID 2").ID = 1001
        .Add("").ToString = "ID 3[id=1002]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .Debug = True
    With .Items
        .Add("ID 1",0,1000)
        .Add("ID 2").ID = 1001
        .Add("").ToString = "ID 3[id=1002]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutDebug(VARIANT_TRUE);
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"ID 1",long(0),long(1000));
    var_Items->Add(L"ID 2",vtMissing,vtMissing)->PutID(1001);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"ID 3[id=1002]");
spToolBar1->Refresh();

C++ Builder

ToolBar1->Debug = true;
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"ID 1",TVariant(0),TVariant(1000));
    var_Items->Add(L"ID 2",TNoParam(),TNoParam())->ID = 1001;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"ID 3[id=1002]";
ToolBar1->Refresh();

C#

extoolbar1.Debug = true;
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("ID 1",0,1000);
    var_Items.Add("ID 2",null,null).ID = 1001;
    var_Items.Add("",null,null).ToString = "ID 3[id=1002]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.Debug = true;
    var var_Items = ToolBar1.Items;
        var_Items.Add("ID 1",0,1000);
        var_Items.Add("ID 2",null,null).ID = 1001;
        var_Items.Add("",null,null).ToString = "ID 3[id=1002]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .Debug = True
        With .Items
            .Add "ID 1",0,1000
            .Add("ID 2").ID = 1001
            .Add("").ToString = "ID 3[id=1002]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.Debug = true;
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("ID 1",0,1000);
    var_Items.Add("ID 2",null,null).ID = 1001;
    var_Items.Add("",null,null).ToString = "ID 3[id=1002]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    extoolbar1.Debug(true);
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("ID 1",COMVariant::createFromInt(0),COMVariant::createFromInt(1000));
        var_Item = COM::createFromObject(com_Items.Add("ID 2")); com_Item = var_Item;
        com_Item.ID(1001);
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("ID 3[id=1002]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    Debug := True;
    with Items do
    begin
        Add('ID 1',TObject(0),TObject(1000));
        Add('ID 2',Nil,Nil).ID := 1001;
        Add('',Nil,Nil).ToString := 'ID 3[id=1002]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    Debug := True;
    with Items do
    begin
        Add('ID 1',OleVariant(0),OleVariant(1000));
        Add('ID 2',Null,Null).ID := 1001;
        Add('',Null,Null).ToString := 'ID 3[id=1002]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .Debug = .T.
    with .Items
        .Add("ID 1",0,1000)
        .Add("ID 2").ID = 1001
        .Add("").ToString = "ID 3[id=1002]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.Debug = true
var_Items = oToolBar.Items
    var_Items.Add("ID 1",0,1000)
    // var_Items.Add("ID 2").ID = 1001
    var_Item = var_Items.Add("ID 2")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.ID = 1001]
    endwith
    // var_Items.Add("").ToString = "ID 3[id=1002]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "ID 3[id=1002]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.Debug = .t.
var_Items = oToolBar.Items
    var_Items.Add("ID 1",0,1000)
    ' var_Items.Add("ID 2").ID = 1001
    var_Item = var_Items.Add("ID 2")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.ID = 1001"

    ' var_Items.Add("").ToString = "ID 3[id=1002]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"ID 3[id=1002]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

oDCOCX_Exontrol1:Debug := true
var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("ID 1",0,1000)
    var_Items:Add("ID 2",nil,nil):ID := 1001
    var_Items:Add("",nil,nil):ToString := "ID 3[id=1002]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
oToolBar.Debug = true
var_Items = oToolBar.Items
    var_Items.Add("ID 1",0,1000)
    var_Items.Add("ID 2").ID = 1001
    var_Items.Add("").ToString = "ID 3[id=1002]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Set ComDebug to True
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "ID 1" 0 1000 to Nothing
        Variant voItem
        Get ComAdd of hoItems "ID 2" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComID of hoItem to 1001
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "ID 3[id=1002]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:Debug := .T.
        oItems := oToolBar:Items()
            oItems:Add("ID 1",0,1000)
            oItems:Add("ID 2"):ID := 1001
            oItems:Add(""):ToString := "ID 3[id=1002]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Image

property Item.Image as Long
Retrieves or sets a value that indicates the item's index image.

Type | Description
Long | A Long expression that specifies the zero-based index of the icon to be displayed on the item.
By default, the Image property is -1, which indicates no icon associated. The Image is displayed on the left side of the item's caption. The Images method should be used to specify a collection of icons to be used by the control. Use the ReplaceIcon method to add, remove or clear icons in the control's images collection. The <img> tag can be used in the Caption property of the Item object to display an Icon or a custom-size picture. Use the HTMLImage property to assign a BMP, JPG, GIF or PNG file to left side of the caption, the same way as you will do with the Image property.

How can I can I assign icons for the item?

VBA (MS Access, Excell...)

With ToolBar1
    .Images "gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" & _
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" & _
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" & _
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" & _
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="
    With .Items
        .Add("Item").Image = 1
        .Add("Item").Image = 2
        .Add "",1
        .Add "Item <img>1</img>"
        .Add "Item <img>2</img>"
        .Add "",1
        .Add("Item <img>1</img>").Image = 1
    End With
    .Refresh
End With

VB6

With ToolBar1
    .Images "gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" & _
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" & _
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" & _
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" & _
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="
    With .Items
        .Add("Item").Image = 1
        .Add("Item").Image = 2
        .Add "",1
        .Add "Item <img>1</img>"
        .Add "Item <img>2</img>"
        .Add "",1
        .Add("Item <img>1</img>").Image = 1
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" & _
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" & _
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" & _
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" & _
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
    With .Items
        .Add("Item").Image = 1
        .Add("Item").Image = 2
        .Add("",1)
        .Add("Item <img>1</img>")
        .Add("Item <img>2</img>")
        .Add("",1)
        .Add("Item <img>1</img>").Image = 1
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" & _
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" & _
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" & _
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" & _
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
    With .Items
        .Add("Item").Image = 1
        .Add("Item").Image = 2
        .Add("",1)
        .Add("Item <img>1</img>")
        .Add("Item <img>2</img>")
        .Add("",1)
        .Add("Item <img>1</img>").Image = 1
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0") +
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" +
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" +
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutImage(1);
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutImage(2);
    var_Items->Add(L"",long(1),vtMissing);
    var_Items->Add(L"Item <img>1</img>",vtMissing,vtMissing);
    var_Items->Add(L"Item <img>2</img>",vtMissing,vtMissing);
    var_Items->Add(L"",long(1),vtMissing);
    var_Items->Add(L"Item <img>1</img>",vtMissing,vtMissing)->PutImage(1);
spToolBar1->Refresh();

C++ Builder

ToolBar1->Images(TVariant(String("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0") +
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" +
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" +
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="));
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Image = 1;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Image = 2;
    var_Items->Add(L"",TVariant(1),TNoParam());
    var_Items->Add(L"Item <img>1</img>",TNoParam(),TNoParam());
    var_Items->Add(L"Item <img>2</img>",TNoParam(),TNoParam());
    var_Items->Add(L"",TVariant(1),TNoParam());
    var_Items->Add(L"Item <img>1</img>",TNoParam(),TNoParam())->Image = 1;
ToolBar1->Refresh();

C#

extoolbar1.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" +
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" +
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" +
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Image = 1;
    var_Items.Add("Item",null,null).Image = 2;
    var_Items.Add("",1,null);
    var_Items.Add("Item <img>1</img>",null,null);
    var_Items.Add("Item <img>2</img>",null,null);
    var_Items.Add("",1,null);
    var_Items.Add("Item <img>1</img>",null,null).Image = 1;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" +
    "/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" +
    "/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" +
    "x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
    "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Image = 1;
        var_Items.Add("Item",null,null).Image = 2;
        var_Items.Add("",1,null);
        var_Items.Add("Item <img>1</img>",null,null);
        var_Items.Add("Item <img>2</img>",null,null);
        var_Items.Add("",1,null);
        var_Items.Add("Item <img>1</img>",null,null).Image = 1;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .Images "gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" & _
    "/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" & _
    "/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" & _
    "x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" & _
    "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="
        With .Items
            .Add("Item").Image = 1
            .Add("Item").Image = 2
            .Add "",1
            .Add "Item <img>1</img>"
            .Add "Item <img>2</img>"
            .Add "",1
            .Add("Item <img>1</img>").Image = 1
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0" +
"/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1" +
"/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qO" +
"x3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Image = 1;
    var_Items.Add("Item",null,null).Image = 2;
    var_Items.Add("",1,null);
    var_Items.Add("Item <img>1</img>",null,null);
    var_Items.Add("Item <img>2</img>",null,null);
    var_Items.Add("",1,null);
    var_Items.Add("Item <img>1</img>",null,null).Image = 1;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    str var_s;
    ;

    super();

    var_s = "gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/";
    var_s = var_s + "oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/";
    var_s = var_s + "wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx";
    var_s = var_s + "3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN";
    var_s = var_s + "AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=";
    extoolbar1.Images(COMVariant::createFromStr(var_s));
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Image(1);
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Image(2);
        com_Items.Add("",COMVariant::createFromInt(1));
        com_Items.Add("Item <img>1</img>");
        com_Items.Add("Item <img>2</img>");
        com_Items.Add("",COMVariant::createFromInt(1));
        var_Item = COM::createFromObject(com_Items.Add("Item <img>1</img>")); com_Item = var_Item;
        com_Item.Image(1);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    Images('gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/' +
    'oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/' +
    'wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx' +
    '3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN' +
    'AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=');
    with Items do
    begin
        Add('Item',Nil,Nil).Image := 1;
        Add('Item',Nil,Nil).Image := 2;
        Add('',TObject(1),Nil);
        Add('Item <img>1</img>',Nil,Nil);
        Add('Item <img>2</img>',Nil,Nil);
        Add('',TObject(1),Nil);
        Add('Item <img>1</img>',Nil,Nil).Image := 1;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    Images('gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/' +
    'oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/' +
    'wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx' +
    '3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN' +
    'AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=');
    with Items do
    begin
        Add('Item',Null,Null).Image := 1;
        Add('Item',Null,Null).Image := 2;
        Add('',OleVariant(1),Null);
        Add('Item <img>1</img>',Null,Null);
        Add('Item <img>2</img>',Null,Null);
        Add('',OleVariant(1),Null);
        Add('Item <img>1</img>',Null,Null).Image := 1;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    var_s = "gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/"
    var_s = var_s + "oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/"
    var_s = var_s + "wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx"
    var_s = var_s + "3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN"
    var_s = var_s + "AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="
    .Images(var_s)
    with .Items
        .Add("Item").Image = 1
        .Add("Item").Image = 2
        .Add("",1)
        .Add("Item <img>1</img>")
        .Add("Item <img>2</img>")
        .Add("",1)
        .Add("Item <img>1</img>").Image = 1
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Items = oToolBar.Items
    // var_Items.Add("Item").Image = 1
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Image = 1]
    endwith
    // var_Items.Add("Item").Image = 2
    var_Item1 = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.Image = 2]
    endwith
    var_Items.Add("",1)
    var_Items.Add("Item <img>1</img>")
    var_Items.Add("Item <img>2</img>")
    var_Items.Add("",1)
    // var_Items.Add("Item <img>1</img>").Image = 1
    var_Item2 = var_Items.Add("Item <img>1</img>")
    with (oToolBar)
        TemplateDef = [Dim var_Item2]
        TemplateDef = var_Item2
        Template = [var_Item2.Image = 1]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Image = 1
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Image = 1"

    ' var_Items.Add("Item").Image = 2
    var_Item1 = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.Image = 2"

    var_Items.Add("",1)
    var_Items.Add("Item <img>1</img>")
    var_Items.Add("Item <img>2</img>")
    var_Items.Add("",1)
    ' var_Items.Add("Item <img>1</img>").Image = 1
    var_Item2 = var_Items.Add("Item <img>1</img>")
    oToolBar.TemplateDef = "Dim var_Item2"
    oToolBar.TemplateDef = var_Item2
    oToolBar.Template = "var_Item2.Image = 1"

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

oDCOCX_Exontrol1:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Image := 1
    var_Items:Add("Item",nil,nil):Image := 2
    var_Items:Add("",1,nil)
    var_Items:Add("Item <img>1</img>",nil,nil)
    var_Items:Add("Item <img>2</img>",nil,nil)
    var_Items:Add("",1,nil)
    var_Items:Add("Item <img>1</img>",nil,nil):Image := 1
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
oToolBar.Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
var_Items = oToolBar.Items
    var_Items.Add("Item").Image = 1
    var_Items.Add("Item").Image = 2
    var_Items.Add("",1)
    var_Items.Add("Item <img>1</img>")
    var_Items.Add("Item <img>2</img>")
    var_Items.Add("",1)
    var_Items.Add("Item <img>1</img>").Image = 1
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Send ComImages "gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComImage of hoItem to 1
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComImage of hoItem1 to 2
        Send Destroy to hoItem1
        Get ComAdd of hoItems "" 1 Nothing to Nothing
        Get ComAdd of hoItems "Item <img>1</img>" Nothing Nothing to Nothing
        Get ComAdd of hoItems "Item <img>2</img>" Nothing Nothing to Nothing
        Get ComAdd of hoItems "" 1 Nothing to Nothing
        Variant voItem2
        Get ComAdd of hoItems "Item <img>1</img>" Nothing Nothing to voItem2
        Handle hoItem2
        Get Create (RefClass(cComItem)) to hoItem2
        Set pvComObject of hoItem2 to voItem2
            Set ComImage of hoItem2 to 1
        Send Destroy to hoItem2
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
        oItems := oToolBar:Items()
            oItems:Add("Item"):Image := 1
            oItems:Add("Item"):Image := 2
            oItems:Add("",1)
            oItems:Add("Item <img>1</img>")
            oItems:Add("Item <img>2</img>")
            oItems:Add("",1)
            oItems:Add("Item <img>1</img>"):Image := 1
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Italic

property Item.Italic as Boolean
Specifies whether the item's caption should appear in italic.

Type | Description
Boolean | A Boolean expression that specifies whether the item's caption is shown in italic.
By default, the Italic property is False. Use the Italic property to show the item's caption in italic. The Caption property indicates the HTML caption to be shown on the item. The <i> HTML tag can be used on the item's Caption property to specify different parts of the caption to be shown in italic.

How can I show the item in italics?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").Italic = True
        .Add "<i>Item</i>"
        .Add("").ToString = "Item[itl]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").Italic = True
        .Add "<i>Item</i>"
        .Add("").ToString = "Item[itl]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").Italic = True
        .Add("<i>Item</i>")
        .Add("").ToString = "Item[itl]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").Italic = True
        .Add("<i>Item</i>")
        .Add("").ToString = "Item[itl]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutItalic(VARIANT_TRUE);
    var_Items->Add(L"<i>Item</i>",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[itl]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Italic = true;
    var_Items->Add(L"<i>Item</i>",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[itl]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Italic = true;
    var_Items.Add("<i>Item</i>",null,null);
    var_Items.Add("",null,null).ToString = "Item[itl]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Italic = true;
        var_Items.Add("<i>Item</i>",null,null);
        var_Items.Add("",null,null).ToString = "Item[itl]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Italic = True
            .Add "<i>Item</i>"
            .Add("").ToString = "Item[itl]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Italic = true;
    var_Items.Add("<i>Item</i>",null,null);
    var_Items.Add("",null,null).ToString = "Item[itl]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Italic(true);
        com_Items.Add("<i>Item</i>");
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[itl]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Italic := True;
        Add('<i>Item</i>',Nil,Nil);
        Add('',Nil,Nil).ToString := 'Item[itl]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Italic := True;
        Add('<i>Item</i>',Null,Null);
        Add('',Null,Null).ToString := 'Item[itl]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").Italic = .T.
        .Add("<i>Item</i>")
        .Add("").ToString = "Item[itl]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Italic = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Italic = true]
    endwith
    var_Items.Add("<i>Item</i>")
    // var_Items.Add("").ToString = "Item[itl]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[itl]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Italic = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Italic = True"

    var_Items.Add("<i>Item</i>")
    ' var_Items.Add("").ToString = "Item[itl]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[itl]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Italic := true
    var_Items:Add("<i>Item</i>",nil,nil)
    var_Items:Add("",nil,nil):ToString := "Item[itl]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Italic = true
    var_Items.Add("<i>Item</i>")
    var_Items.Add("").ToString = "Item[itl]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComItalic of hoItem to True
        Send Destroy to hoItem
        Get ComAdd of hoItems "<i>Item</i>" Nothing Nothing to Nothing
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[itl]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):Italic := .T.
            oItems:Add("<i>Item</i>")
            oItems:Add(""):ToString := "Item[itl]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ItemHeight

property Item.ItemHeight as Long
Specifies the fixed height to display the item.

Type | Description
Long | A Long expression that specifies the height of the item
The ItemHeight property specifies the height to display the item. By default, the ItemHeight property is -1, which indicates that the control sets the item height based on on its content. If the ItemHeight property is positive, it indicates the height to display the item. The CaptionWidth property specifies the fixed width to display the item's caption.

How can I specify the height of the item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").ItemHeight = 64
        .Add("").ToString = "Item[height=64]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").ItemHeight = 64
        .Add("").ToString = "Item[height=64]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .BackColor = Color.FromArgb(250,250,250)
        .Add("Item").ItemHeight = 64
        .Add("").ToString = "Item[height=64]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").ItemHeight = 64
        .Add("").ToString = "Item[height=64]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->PutBackColor(RGB(250,250,250));
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutItemHeight(64);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[height=64]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->BackColor = RGB(250,250,250);
    var_Items->Add(L"Item",TNoParam(),TNoParam())->ItemHeight = 64;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[height=64]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.BackColor = Color.FromArgb(250,250,250);
    var_Items.Add("Item",null,null).ItemHeight = 64;
    var_Items.Add("",null,null).ToString = "Item[height=64]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.BackColor = 16448250;
        var_Items.Add("Item",null,null).ItemHeight = 64;
        var_Items.Add("",null,null).ToString = "Item[height=64]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .BackColor = RGB(250,250,250)
            .Add("Item").ItemHeight = 64
            .Add("").ToString = "Item[height=64]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.BackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(250,250,250));
    var_Items.Add("Item",null,null).ItemHeight = 64;
    var_Items.Add("",null,null).ToString = "Item[height=64]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.BackColor(WinApi::RGB2int(250,250,250));
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.ItemHeight(64);
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[height=64]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Nil,Nil).ItemHeight := 64;
        Add('',Nil,Nil).ToString := 'Item[height=64]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Null,Null).ItemHeight := 64;
        Add('',Null,Null).ToString := 'Item[height=64]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").ItemHeight = 64
        .Add("").ToString = "Item[height=64]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.BackColor = 0xfafafa
    // var_Items.Add("Item").ItemHeight = 64
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.ItemHeight = 64]
    endwith
    // var_Items.Add("").ToString = "Item[height=64]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[height=64]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.BackColor = 16448250
    ' var_Items.Add("Item").ItemHeight = 64
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.ItemHeight = 64"

    ' var_Items.Add("").ToString = "Item[height=64]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[height=64]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:BackColor := RGB(250,250,250)
    var_Items:Add("Item",nil,nil):ItemHeight := 64
    var_Items:Add("",nil,nil):ToString := "Item[height=64]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.BackColor = RGB(250,250,250)
    var_Items.Add("Item").ItemHeight = 64
    var_Items.Add("").ToString = "Item[height=64]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Set ComBackColor of hoItems to (RGB(250,250,250))
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComItemHeight of hoItem to 64
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[height=64]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 250,250,250 } )  , .F. ))
            oItems:Add("Item"):ItemHeight := 64
            oItems:Add(""):ToString := "Item[height=64]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Items

property Item.Items as Items
Retrieves an Items collection that indicates the item's sub menu. Retrieves Nothing, if the item contains no sub menu.

Type | Description
Items | An Items collection that holds the Item objects to be displayed in the sub-menu.
The Items and SubMenu properties are equivalents. Use the Items property to access the Item objects in a sub-menu item. The Parent property of the Item object returns an empty object, if the item contains no parent. The Parent item property can be used to access the parent of the item, when it is contained by a sub-menu.


property ItemType

property Item.ItemType as ItemTypeEnum
Returns the type of the item.

Type | Description
ItemTypeEnum | An ItemTypeEnum expression that specifies the type of the item.
The ItemType property is a read-only property that gets the type of the item. Use the Debug property to display debugging information in the item's Caption. Use the Get method to get a collection of Item objects that meet your criteria.


property Padding

property Item.Padding as String
Specifies the padding (space between the menu border and the item content) to display the item.

Type | Description
String | A string expression that indicates a list of 4 positive numbers separated by comma characters, which indicates the distance in pixels from margin to client, in the following format: left, top, right, bottom.
By default, the Padding property is empty "0,0,0,0". The Padding property specifies the padding for a particular item. The Padding property specifies the padding (space between the menu border and the item content) to display the item. The Caption property indicates the item's caption to be shown on the item. The BackColor property specifies a different background color or a visual appearance for the item. The Padding property of the Items collection specifies the padding for all items in the collection.

Does your control implement padding for item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").Padding = "4,4,4,4"
        .Add("").ToString = "Item[pad=4,4,4,4]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").Padding = "4,4,4,4"
        .Add("").ToString = "Item[pad=4,4,4,4]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .BackColor = Color.FromArgb(250,250,250)
        .Add("Item").Padding = "4,4,4,4"
        .Add("").ToString = "Item[pad=4,4,4,4]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").Padding = "4,4,4,4"
        .Add("").ToString = "Item[pad=4,4,4,4]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->PutBackColor(RGB(250,250,250));
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutPadding(L"4,4,4,4");
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[pad=4,4,4,4]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->BackColor = RGB(250,250,250);
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Padding = L"4,4,4,4";
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[pad=4,4,4,4]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.BackColor = Color.FromArgb(250,250,250);
    var_Items.Add("Item",null,null).Padding = "4,4,4,4";
    var_Items.Add("",null,null).ToString = "Item[pad=4,4,4,4]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.BackColor = 16448250;
        var_Items.Add("Item",null,null).Padding = "4,4,4,4";
        var_Items.Add("",null,null).ToString = "Item[pad=4,4,4,4]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .BackColor = RGB(250,250,250)
            .Add("Item").Padding = "4,4,4,4"
            .Add("").ToString = "Item[pad=4,4,4,4]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.BackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(250,250,250));
    var_Items.Add("Item",null,null).Padding = "4,4,4,4";
    var_Items.Add("",null,null).ToString = "Item[pad=4,4,4,4]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.BackColor(WinApi::RGB2int(250,250,250));
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Padding("4,4,4,4");
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[pad=4,4,4,4]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Nil,Nil).Padding := '4,4,4,4';
        Add('',Nil,Nil).ToString := 'Item[pad=4,4,4,4]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        BackColor := $fafafa;
        Add('Item',Null,Null).Padding := '4,4,4,4';
        Add('',Null,Null).ToString := 'Item[pad=4,4,4,4]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .BackColor = RGB(250,250,250)
        .Add("Item").Padding = "4,4,4,4"
        .Add("").ToString = "Item[pad=4,4,4,4]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.BackColor = 0xfafafa
    // var_Items.Add("Item").Padding = "4,4,4,4"
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Padding = "4,4,4,4"]
    endwith
    // var_Items.Add("").ToString = "Item[pad=4,4,4,4]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[pad=4,4,4,4]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.BackColor = 16448250
    ' var_Items.Add("Item").Padding = "4,4,4,4"
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Padding = \"4,4,4,4\""

    ' var_Items.Add("").ToString = "Item[pad=4,4,4,4]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[pad=4,4,4,4]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:BackColor := RGB(250,250,250)
    var_Items:Add("Item",nil,nil):Padding := "4,4,4,4"
    var_Items:Add("",nil,nil):ToString := "Item[pad=4,4,4,4]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.BackColor = RGB(250,250,250)
    var_Items.Add("Item").Padding = "4,4,4,4"
    var_Items.Add("").ToString = "Item[pad=4,4,4,4]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Set ComBackColor of hoItems to (RGB(250,250,250))
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComPadding of hoItem to "4,4,4,4"
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[pad=4,4,4,4]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 250,250,250 } )  , .F. ))
            oItems:Add("Item"):Padding := "4,4,4,4"
            oItems:Add(""):ToString := "Item[pad=4,4,4,4]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Parent

property Item.Parent as Item
Gets the item's parent, if the current item belongs to a submenu/popup.

Type | Description
Item | An Item object that specifies the parent item of the current item.
The Parent property of the Item object returns an empty object, if the item contains no parent. The Parent item property can be used to access the parent of the item, when it is contained by a sub-menu. Use the Items property to access the Item objects in a sub-menu item.


property Position

property Item.Position as Long
Specifies the position of the item, within its collection.

Type | Description
Long | A long expression that specifies the position of the item ( 0-based )
The Position property specifies the position of the item, within its collection. You can use the Position property to change the position of specified item. The Count property returns the number of objects in a collection. The Visible property specifies whether the item is visible or hidden.


property Radio

property Item.Radio as Boolean
Retrieves or sets a value that indicates whether the item is of radio type.

Type | Description
Boolean | A Boolean expression that specifies whether the item displays a radio button.
The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked. The Checked property specifies whether the item is checked or un-checked. The GetRadio method gets a safe array with the radio-items being checked within a radio group. Use the Background(exRadioButtonState0)/Background(exRadioButtonState1) property to specify the visual appearance of the radio-buttons in the control. Use the UseVisualTheme property to specify whether the visual appearance for the radio-buttons to be as indicated by the current XP theme. The AllowToggleRadio property on True, allows a radio button to set on zero ( unchecked ), if the user clicks twice the radio button. Usually, clicking a radio-button makes the previously checked radio-button in the same group, to be un-checked, and the newly clicked item to be checked. Now, if the AllowToggleRadio property is True, clicking again the radio-button, allows the radio-button to be un-checked, so allows a radio group to have no radio button checked. Use the ShowCheckedAsSelected property on True, to show the checked items as selected.

How can I add radio buttons to items?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = 1
            With .Items
                With .Add("Radio 1",0,1000)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1001)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1003)
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Item(1000).Checked = True
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = exGroupPopup
            With .Items
                With .Add("Radio 1",0,1000)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1001)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1003)
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Item(1000).Checked = True
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Radio 1",0,1000)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1001)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1003)
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Item(1000).Checked = True
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Radio 1",0,1000)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1001)
                    .Radio = True
                    .RadioGroup = 100
                End With
                With .Add("Radio 2",0,1003)
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Item(1000).Checked = True
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::exGroupPopup);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Radio 1",long(0),long(1000));
                var_Item1->PutRadio(VARIANT_TRUE);
                var_Item1->PutRadioGroup(100);
            EXTOOLBARLib::IItemPtr var_Item2 = var_Items1->Add(L"Radio 2",long(0),long(1001));
                var_Item2->PutRadio(VARIANT_TRUE);
                var_Item2->PutRadioGroup(100);
            EXTOOLBARLib::IItemPtr var_Item3 = var_Items1->Add(L"Radio 2",long(0),long(1003));
                var_Item3->PutRadio(VARIANT_TRUE);
                var_Item3->PutRadioGroup(100);
            var_Items1->GetItem(long(1000))->PutChecked(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Radio 1",TVariant(0),TVariant(1000));
                var_Item1->Radio = true;
                var_Item1->RadioGroup = 100;
            Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items1->Add(L"Radio 2",TVariant(0),TVariant(1001));
                var_Item2->Radio = true;
                var_Item2->RadioGroup = 100;
            Extoolbarlib_tlb::IItemPtr var_Item3 = var_Items1->Add(L"Radio 2",TVariant(0),TVariant(1003));
                var_Item3->Radio = true;
                var_Item3->RadioGroup = 100;
            var_Items1->get_Item(TVariant(1000))->Checked = true;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 1",0,1000);
                var_Item1.Radio = true;
                var_Item1.RadioGroup = 100;
            exontrol.EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Radio 2",0,1001);
                var_Item2.Radio = true;
                var_Item2.RadioGroup = 100;
            exontrol.EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Radio 2",0,1003);
                var_Item3.Radio = true;
                var_Item3.RadioGroup = 100;
            var_Items1[1000].Checked = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 1;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Radio 1",0,1000);
                    var_Item1.Radio = true;
                    var_Item1.RadioGroup = 100;
                var var_Item2 = var_Items1.Add("Radio 2",0,1001);
                    var_Item2.Radio = true;
                    var_Item2.RadioGroup = 100;
                var var_Item3 = var_Items1.Add("Radio 2",0,1003);
                    var_Item3.Radio = true;
                    var_Item3.RadioGroup = 100;
                var_Items1.Item(1000).Checked = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                .GroupPopup = 1
                With .Items
                    With .Add("Radio 1",0,1000)
                        .Radio = True
                        .RadioGroup = 100
                    End With
                    With .Add("Radio 2",0,1001)
                        .Radio = True
                        .RadioGroup = 100
                    End With
                    With .Add("Radio 2",0,1003)
                        .Radio = True
                        .RadioGroup = 100
                    End With
                    .Item(1000).Checked = True
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 1",0,1000);
                var_Item1.Radio = true;
                var_Item1.RadioGroup = 100;
            EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Radio 2",0,1001);
                var_Item2.Radio = true;
                var_Item2.RadioGroup = 100;
            EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Radio 2",0,1003);
                var_Item3.Radio = true;
                var_Item3.RadioGroup = 100;
            var_Items1[1000].Checked = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Item3,com_Item4,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Item2,var_Item3,var_Item4,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(1/*exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Radio 1",COMVariant::createFromInt(0),COMVariant::createFromInt(1000)); com_Item1 = var_Item1;
                    com_Item1.Radio(true);
                    com_Item1.RadioGroup(100);
                var_Item2 = com_Items1.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1001)); com_Item2 = var_Item2;
                    com_Item2.Radio(true);
                    com_Item2.RadioGroup(100);
                var_Item3 = com_Items1.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1003)); com_Item3 = var_Item3;
                    com_Item3.Radio(true);
                    com_Item3.RadioGroup(100);
                var_Item4 = COM::createFromObject(com_Items1.Item(COMVariant::createFromInt(1000))); com_Item4 = var_Item4;
                com_Item4.Checked(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
            with Items do
            begin
                with Add('Radio 1',TObject(0),TObject(1000)) do
                begin
                    Radio := True;
                    RadioGroup := 100;
                end;
                with Add('Radio 2',TObject(0),TObject(1001)) do
                begin
                    Radio := True;
                    RadioGroup := 100;
                end;
                with Add('Radio 2',TObject(0),TObject(1003)) do
                begin
                    Radio := True;
                    RadioGroup := 100;
                end;
                Item[TObject(1000)].Checked := True;
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := EXTOOLBARLib_TLB.exGroupPopup;
            with Items do
            begin
                with Add('Radio 1',OleVariant(0),OleVariant(1000)) do
                begin
                    Radio := True;
                    RadioGroup := 100;
                end;
                with Add('Radio 2',OleVariant(0),OleVariant(1001)) do
                begin
                    Radio := True;
                    RadioGroup := 100;
                end;
                with Add('Radio 2',OleVariant(0),OleVariant(1003)) do
                begin
                    Radio := True;
                    RadioGroup := 100;
                end;
                Item[OleVariant(1000)].Checked := True;
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            .GroupPopup = 1
            with .Items
                with .Add("Radio 1",0,1000)
                    .Radio = .T.
                    .RadioGroup = 100
                endwith
                with .Add("Radio 2",0,1001)
                    .Radio = .T.
                    .RadioGroup = 100
                endwith
                with .Add("Radio 2",0,1003)
                    .Radio = .T.
                    .RadioGroup = 100
                endwith
                .Item(1000).Checked = .T.
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Item4,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 1
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Radio 1",0,1000)
                var_Item1.Radio = true
                var_Item1.RadioGroup = 100
            var_Item2 = var_Items1.Add("Radio 2",0,1001)
                var_Item2.Radio = true
                var_Item2.RadioGroup = 100
            var_Item3 = var_Items1.Add("Radio 2",0,1003)
                var_Item3.Radio = true
                var_Item3.RadioGroup = 100
            // var_Items1.Item(1000).Checked = true
            var_Item4 = var_Items1.Item(1000)
            with (oToolBar)
                TemplateDef = [Dim var_Item4]
                TemplateDef = var_Item4
                Template = [var_Item4.Checked = true]
            endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Item3 as P
Dim var_Item4 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 1
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Radio 1",0,1000)
                var_Item1.Radio = .t.
                var_Item1.RadioGroup = 100
            var_Item2 = var_Items1.Add("Radio 2",0,1001)
                var_Item2.Radio = .t.
                var_Item2.RadioGroup = 100
            var_Item3 = var_Items1.Add("Radio 2",0,1003)
                var_Item3.Radio = .t.
                var_Item3.RadioGroup = 100
            ' var_Items1.Item(1000).Checked = .t.
            var_Item4 = var_Items1.Item(1000)
            oToolBar.TemplateDef = "Dim var_Item4"
            oToolBar.TemplateDef = var_Item4
            oToolBar.Template = "var_Item4.Checked = True"

oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1,var_Item2,var_Item3 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Radio 1",0,1000)
                var_Item1:Radio := true
                var_Item1:RadioGroup := 100
            var_Item2 := var_Items1:Add("Radio 2",0,1001)
                var_Item2:Radio := true
                var_Item2:RadioGroup := 100
            var_Item3 := var_Items1:Add("Radio 2",0,1003)
                var_Item3:Radio := true
                var_Item3:RadioGroup := 100
            var_Items1:[Item,1000]:Checked := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 1
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Radio 1",0,1000)
                var_Item1.Radio = true
                var_Item1.RadioGroup = 100
            var_Item2 = var_Items1.Add("Radio 2",0,1001)
                var_Item2.Radio = true
                var_Item2.RadioGroup = 100
            var_Item3 = var_Items1.Add("Radio 2",0,1003)
                var_Item3.Radio = true
                var_Item3.RadioGroup = 100
            var_Items1.Item(1000).Checked = true
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to OLEexGroupPopup
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Radio 1" 0 1000 to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComRadio of hoItem1 to True
                    Set ComRadioGroup of hoItem1 to 100
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Radio 2" 0 1001 to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComRadio of hoItem2 to True
                    Set ComRadioGroup of hoItem2 to 100
                Send Destroy to hoItem2
                Variant voItem3
                Get ComAdd of hoItems1 "Radio 2" 0 1003 to voItem3
                Handle hoItem3
                Get Create (RefClass(cComItem)) to hoItem3
                Set pvComObject of hoItem3 to voItem3
                    Set ComRadio of hoItem3 to True
                    Set ComRadioGroup of hoItem3 to 100
                Send Destroy to hoItem3
                Variant voItem4
                Get ComItem of hoItems1 1000 to voItem4
                Handle hoItem4
                Get Create (RefClass(cComItem)) to hoItem4
                Set pvComObject of hoItem4 to voItem4
                    Set ComChecked of hoItem4 to True
                Send Destroy to hoItem4
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1,oItem2,oItem3
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 1/*exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Radio 1",0,1000)
                        oItem1:Radio := .T.
                        oItem1:RadioGroup := 100
                    oItem2 := oItems1:Add("Radio 2",0,1001)
                        oItem2:Radio := .T.
                        oItem2:RadioGroup := 100
                    oItem3 := oItems1:Add("Radio 2",0,1003)
                        oItem3:Radio := .T.
                        oItem3:RadioGroup := 100
                    oItems1:Item(1000):Checked := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property RadioGroup

property Item.RadioGroup as Long
Indicates the group of radio items that the current item belongs.

Type | Description
Long | A Long expression that specifies the identifier of the radio group. A radio group allows a single radio-item to be checked inside. If the RadioGroup property is not specified, all radio-buttons in the controls are in the same group 0.
The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked inside. The Radio property specifies whether the item displays a radio-button. The Checked property specifies whether the item is checked or un-checked. The GetRadio method gets a safe array with the radio-items being checked within a radio group. Use the Background(exRadioButtonState0)/Background(exRadioButtonState1) property to specify the visual appearance of the radio-buttons in the control. Use the UseVisualTheme property to specify whether the visual appearance for the radio-buttons to be as indicated by the current XP theme. The AllowToggleRadio property on True, allows a radio button to set on zero ( unchecked ), if the user clicks twice the radio button. Usually, clicking a radio-button makes the previously checked radio-button in the same group, to be un-checked, and the newly clicked item to be checked. Now, if the AllowToggleRadio property is True, clicking again the radio-button, allows the radio-button to be un-checked, so allows a radio group to have no radio button checked.

I am using radio-buttons, the question is it possible to uncheck the radio-buttons, so no button is pressed in the group?

VBA (MS Access, Excell...)

With ToolBar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutAllowToggleRadio(VARIANT_TRUE);
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Radio 1",long(0),long(1000));
        var_Item->PutRadio(VARIANT_TRUE);
        var_Item->PutRadioGroup(100);
    EXTOOLBARLib::IItemPtr var_Item1 = var_Items->Add(L"Radio 2",long(0),long(1001));
        var_Item1->PutRadio(VARIANT_TRUE);
        var_Item1->PutRadioGroup(100);
    EXTOOLBARLib::IItemPtr var_Item2 = var_Items->Add(L"Radio 2",long(0),long(1003));
        var_Item2->PutRadio(VARIANT_TRUE);
        var_Item2->PutRadioGroup(100);
spToolBar1->Refresh();

C++ Builder

ToolBar1->AllowToggleRadio = true;
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Radio 1",TVariant(0),TVariant(1000));
        var_Item->Radio = true;
        var_Item->RadioGroup = 100;
    Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items->Add(L"Radio 2",TVariant(0),TVariant(1001));
        var_Item1->Radio = true;
        var_Item1->RadioGroup = 100;
    Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items->Add(L"Radio 2",TVariant(0),TVariant(1003));
        var_Item2->Radio = true;
        var_Item2->RadioGroup = 100;
ToolBar1->Refresh();

C#

extoolbar1.AllowToggleRadio = true;
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Radio 1",0,1000);
        var_Item.Radio = true;
        var_Item.RadioGroup = 100;
    exontrol.EXTOOLBARLib.Item var_Item1 = var_Items.Add("Radio 2",0,1001);
        var_Item1.Radio = true;
        var_Item1.RadioGroup = 100;
    exontrol.EXTOOLBARLib.Item var_Item2 = var_Items.Add("Radio 2",0,1003);
        var_Item2.Radio = true;
        var_Item2.RadioGroup = 100;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.AllowToggleRadio = true;
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Radio 1",0,1000);
            var_Item.Radio = true;
            var_Item.RadioGroup = 100;
        var var_Item1 = var_Items.Add("Radio 2",0,1001);
            var_Item1.Radio = true;
            var_Item1.RadioGroup = 100;
        var var_Item2 = var_Items.Add("Radio 2",0,1003);
            var_Item2.Radio = true;
            var_Item2.RadioGroup = 100;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .AllowToggleRadio = True
        With .Items
            With .Add("Radio 1",0,1000)
                .Radio = True
                .RadioGroup = 100
            End With
            With .Add("Radio 2",0,1001)
                .Radio = True
                .RadioGroup = 100
            End With
            With .Add("Radio 2",0,1003)
                .Radio = True
                .RadioGroup = 100
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.AllowToggleRadio = true;
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Radio 1",0,1000);
        var_Item.Radio = true;
        var_Item.RadioGroup = 100;
    EXTOOLBARLib.Item var_Item1 = var_Items.Add("Radio 2",0,1001);
        var_Item1.Radio = true;
        var_Item1.RadioGroup = 100;
    EXTOOLBARLib.Item var_Item2 = var_Items.Add("Radio 2",0,1003);
        var_Item2.Radio = true;
        var_Item2.RadioGroup = 100;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Items;
    anytype var_Item,var_Item1,var_Item2,var_Items;
    ;

    super();

    extoolbar1.AllowToggleRadio(true);
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Radio 1",COMVariant::createFromInt(0),COMVariant::createFromInt(1000)); com_Item = var_Item;
            com_Item.Radio(true);
            com_Item.RadioGroup(100);
        var_Item1 = com_Items.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1001)); com_Item1 = var_Item1;
            com_Item1.Radio(true);
            com_Item1.RadioGroup(100);
        var_Item2 = com_Items.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1003)); com_Item2 = var_Item2;
            com_Item2.Radio(true);
            com_Item2.RadioGroup(100);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    AllowToggleRadio := True;
    with Items do
    begin
        with Add('Radio 1',TObject(0),TObject(1000)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',TObject(0),TObject(1001)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',TObject(0),TObject(1003)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    AllowToggleRadio := True;
    with Items do
    begin
        with Add('Radio 1',OleVariant(0),OleVariant(1000)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',OleVariant(0),OleVariant(1001)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',OleVariant(0),OleVariant(1003)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .AllowToggleRadio = .T.
    with .Items
        with .Add("Radio 1",0,1000)
            .Radio = .T.
            .RadioGroup = 100
        endwith
        with .Add("Radio 2",0,1001)
            .Radio = .T.
            .RadioGroup = 100
        endwith
        with .Add("Radio 2",0,1003)
            .Radio = .T.
            .RadioGroup = 100
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.AllowToggleRadio = true
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Radio 1",0,1000)
        var_Item.Radio = true
        var_Item.RadioGroup = 100
    var_Item1 = var_Items.Add("Radio 2",0,1001)
        var_Item1.Radio = true
        var_Item1.RadioGroup = 100
    var_Item2 = var_Items.Add("Radio 2",0,1003)
        var_Item2.Radio = true
        var_Item2.RadioGroup = 100
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.AllowToggleRadio = .t.
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Radio 1",0,1000)
        var_Item.Radio = .t.
        var_Item.RadioGroup = 100
    var_Item1 = var_Items.Add("Radio 2",0,1001)
        var_Item1.Radio = .t.
        var_Item1.RadioGroup = 100
    var_Item2 = var_Items.Add("Radio 2",0,1003)
        var_Item2.Radio = .t.
        var_Item2.RadioGroup = 100
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1,var_Item2 as IItem
local var_Items as IItems

oDCOCX_Exontrol1:AllowToggleRadio := true
var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Radio 1",0,1000)
        var_Item:Radio := true
        var_Item:RadioGroup := 100
    var_Item1 := var_Items:Add("Radio 2",0,1001)
        var_Item1:Radio := true
        var_Item1:RadioGroup := 100
    var_Item2 := var_Items:Add("Radio 2",0,1003)
        var_Item2:Radio := true
        var_Item2:RadioGroup := 100
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Items

oToolBar = ole_1.Object
oToolBar.AllowToggleRadio = true
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Radio 1",0,1000)
        var_Item.Radio = true
        var_Item.RadioGroup = 100
    var_Item1 = var_Items.Add("Radio 2",0,1001)
        var_Item1.Radio = true
        var_Item1.RadioGroup = 100
    var_Item2 = var_Items.Add("Radio 2",0,1003)
        var_Item2.Radio = true
        var_Item2.RadioGroup = 100
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Set ComAllowToggleRadio to True
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Radio 1" 0 1000 to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComRadio of hoItem to True
            Set ComRadioGroup of hoItem to 100
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Radio 2" 0 1001 to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComRadio of hoItem1 to True
            Set ComRadioGroup of hoItem1 to 100
        Send Destroy to hoItem1
        Variant voItem2
        Get ComAdd of hoItems "Radio 2" 0 1003 to voItem2
        Handle hoItem2
        Get Create (RefClass(cComItem)) to hoItem2
        Set pvComObject of hoItem2 to voItem2
            Set ComRadio of hoItem2 to True
            Set ComRadioGroup of hoItem2 to 100
        Send Destroy to hoItem2
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1,oItem2
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:AllowToggleRadio := .T.
        oItems := oToolBar:Items()
            oItem := oItems:Add("Radio 1",0,1000)
                oItem:Radio := .T.
                oItem:RadioGroup := 100
            oItem1 := oItems:Add("Radio 2",0,1001)
                oItem1:Radio := .T.
                oItem1:RadioGroup := 100
            oItem2 := oItems:Add("Radio 2",0,1003)
                oItem2:Radio := .T.
                oItem2:RadioGroup := 100
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property SelBackColor

property Item.SelBackColor as Color
Specifies the background color of the item when it is selected.

Type | Description
Color | A Color expression that specifies the item's background color, when the item is selected/checked. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The SelBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked. The BackColor property specifies the item's background color of the item. The SelHotBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked, and the cursor hovers it. The HotBackColor property specifies a different background color or a visual appearance for the item, when the cursor hovers it. The Caption property indicates the item's caption to be shown on the item. You can use the <bgcolor> HTML tag in the Caption property to specify a different background color for parts of the caption.

How can I change the item's background/backcolor, when the item is selected/checked (check-box)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Check 1")
            .HotBackColor = RGB(255,255,255)
            .SelBackColor = RGB(255,0,0)
            .SelHotBackColor = RGB(255,0,0)
            .ShowCheckedAsSelected = 1
            .Checked = True
            .Check = True
        End With
        .Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" & _
"]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Check 1")
            .HotBackColor = RGB(255,255,255)
            .SelBackColor = RGB(255,0,0)
            .SelHotBackColor = RGB(255,0,0)
            .ShowCheckedAsSelected = exDisplayItemHighlight
            .Checked = True
            .Check = True
        End With
        .Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" & _
"]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Check 1")
            .HotBackColor = Color.FromArgb(255,255,255)
            .SelBackColor = Color.FromArgb(255,0,0)
            .SelHotBackColor = Color.FromArgb(255,0,0)
            .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
            .Checked = True
            .Check = True
        End With
        .Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" & _
"]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Check 1")
            .HotBackColor = RGB(255,255,255)
            .SelBackColor = RGB(255,0,0)
            .SelHotBackColor = RGB(255,0,0)
            .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
            .Checked = True
            .Check = True
        End With
        .Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" & _
"]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Check 1",vtMissing,vtMissing);
        var_Item->PutHotBackColor(RGB(255,255,255));
        var_Item->PutSelBackColor(RGB(255,0,0));
        var_Item->PutSelHotBackColor(RGB(255,0,0));
        var_Item->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight);
        var_Item->PutChecked(VARIANT_TRUE);
        var_Item->PutCheck(VARIANT_TRUE);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(_bstr_t("Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)") +
"]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Check 1",TNoParam(),TNoParam());
        var_Item->HotBackColor = RGB(255,255,255);
        var_Item->SelBackColor = RGB(255,0,0);
        var_Item->SelHotBackColor = RGB(255,0,0);
        var_Item->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight;
        var_Item->Checked = true;
        var_Item->Check = true;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = TVariant(String("Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)") +
"]");
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Check 1",null,null);
        var_Item.HotBackColor = Color.FromArgb(255,255,255);
        var_Item.SelBackColor = Color.FromArgb(255,0,0);
        var_Item.SelHotBackColor = Color.FromArgb(255,0,0);
        var_Item.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
        var_Item.Checked = true;
        var_Item.Check = true;
    var_Items.Add("",null,null).ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" +
"]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Check 1",null,null);
            var_Item.HotBackColor = 16777215;
            var_Item.SelBackColor = 255;
            var_Item.SelHotBackColor = 255;
            var_Item.ShowCheckedAsSelected = 1;
            var_Item.Checked = true;
            var_Item.Check = true;
        var_Items.Add("",null,null).ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" +
    "]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Check 1")
                .HotBackColor = RGB(255,255,255)
                .SelBackColor = RGB(255,0,0)
                .SelHotBackColor = RGB(255,0,0)
                .ShowCheckedAsSelected = 1
                .Checked = True
                .Check = True
            End With
            .Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" & _
    "]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Check 1",null,null);
        var_Item.HotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,255,255));
        var_Item.SelBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
        var_Item.SelHotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
        var_Item.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
        var_Item.Checked = true;
        var_Item.Check = true;
    var_Items.Add("",null,null).ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)" +
"]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items;
    anytype var_Item,var_Item1,var_Items;
    str var_s;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Check 1"); com_Item = var_Item;
            com_Item.HotBackColor(WinApi::RGB2int(255,255,255));
            com_Item.SelBackColor(WinApi::RGB2int(255,0,0));
            com_Item.SelHotBackColor(WinApi::RGB2int(255,0,0));
            com_Item.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/);
            com_Item.Checked(true);
            com_Item.Check(true);
        var_Item1 = COM::createFromObject(com_Items.Add("")); com_Item1 = var_Item1;
        var_s = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]";
        com_Item1.ToString(var_s);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Check 1',Nil,Nil) do
        begin
            HotBackColor := $ffffff;
            SelBackColor := $ff;
            SelHotBackColor := $ff;
            ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
            Checked := True;
            Check := True;
        end;
        Add('',Nil,Nil).ToString := 'Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]' +
    '';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Check 1',Null,Null) do
        begin
            HotBackColor := $ffffff;
            SelBackColor := $ff;
            SelHotBackColor := $ff;
            ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight;
            Checked := True;
            Check := True;
        end;
        Add('',Null,Null).ToString := 'Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]' +
    '';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Check 1")
            .HotBackColor = RGB(255,255,255)
            .SelBackColor = RGB(255,0,0)
            .SelHotBackColor = RGB(255,0,0)
            .ShowCheckedAsSelected = 1
            .Checked = .T.
            .Check = .T.
        endwith
        var_s = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
        .Add("").ToString = var_s
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Check 1")
        var_Item.HotBackColor = 0xffffff
        var_Item.SelBackColor = 0xff
        var_Item.SelHotBackColor = 0xff
        var_Item.ShowCheckedAsSelected = 1
        var_Item.Checked = true
        var_Item.Check = true
    // var_Items.Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Check 1")
        var_Item.HotBackColor = 16777215
        var_Item.SelBackColor = 255
        var_Item.SelHotBackColor = 255
        var_Item.ShowCheckedAsSelected = 1
        var_Item.Checked = .t.
        var_Item.Check = .t.
    ' var_Items.Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]\""

oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Check 1",nil,nil)
        var_Item:HotBackColor := RGB(255,255,255)
        var_Item:SelBackColor := RGB(255,0,0)
        var_Item:SelHotBackColor := RGB(255,0,0)
        var_Item:ShowCheckedAsSelected := exDisplayItemHighlight
        var_Item:Checked := true
        var_Item:Check := true
    var_Items:Add("",nil,nil):ToString := "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Check 1")
        var_Item.HotBackColor = RGB(255,255,255)
        var_Item.SelBackColor = RGB(255,0,0)
        var_Item.SelHotBackColor = RGB(255,0,0)
        var_Item.ShowCheckedAsSelected = 1
        var_Item.Checked = true
        var_Item.Check = true
    var_Items.Add("").ToString = "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Check 1" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComHotBackColor of hoItem to (RGB(255,255,255))
            Set ComSelBackColor of hoItem to (RGB(255,0,0))
            Set ComSelHotBackColor of hoItem to (RGB(255,0,0))
            Set ComShowCheckedAsSelected of hoItem to OLEexDisplayItemHighlight
            Set ComChecked of hoItem to True
            Set ComCheck of hoItem to True
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Check 1")
                oItem:SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
                oItem:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
                oItem:SetProperty("SelHotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
                oItem:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/
                oItem:Checked := .T.
                oItem:Check := .T.
            oItems:Add(""):ToString := "Check 2[typ=1][chk=0][show=1][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property SelHotBackColor

property Item.SelHotBackColor as Color
Specifies the background color of the selected item when the cursor hovers it.

Type | Description
Color | A Color expression that specifies the item's background color, when the item is selected/checked and the cursor hovers it. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The SelHotBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked, and the cursor hovers it. The SelBackColor property specifies a different background color or a visual appearance for the item, when item is selected / checked. The BackColor property specifies the item's background color of the item. The HotBackColor property specifies a different background color or a visual appearance for the item, when the cursor hovers it. The Caption property indicates the item's caption to be shown on the item. You can use the <bgcolor> HTML tag in the Caption property to specify a different background color for parts of the caption.

How can I change the item's background/backcolor, when the item is selected/checked (radio-buttons)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Radio 1")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = 1
                    .Radio = True
                    .RadioGroup = 100
                    .Checked = True
                End With
                With .Add("Radio 2")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = 1
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," & _
"0)]"
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Radio 1")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = exDisplayItemHighlight
                    .Radio = True
                    .RadioGroup = 100
                    .Checked = True
                End With
                With .Add("Radio 2")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = exDisplayItemHighlight
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," & _
"0)]"
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Radio 1")
                    .HotBackColor = Color.FromArgb(255,255,255)
                    .SelBackColor = Color.FromArgb(255,0,0)
                    .SelHotBackColor = Color.FromArgb(255,0,0)
                    .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                    .Radio = True
                    .RadioGroup = 100
                    .Checked = True
                End With
                With .Add("Radio 2")
                    .HotBackColor = Color.FromArgb(255,255,255)
                    .SelBackColor = Color.FromArgb(255,0,0)
                    .SelHotBackColor = Color.FromArgb(255,0,0)
                    .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," & _
"0)]"
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Radio 1")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                    .Radio = True
                    .RadioGroup = 100
                    .Checked = True
                End With
                With .Add("Radio 2")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                    .Radio = True
                    .RadioGroup = 100
                End With
                .Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," & _
"0)]"
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Radio 1",vtMissing,vtMissing);
                var_Item1->PutHotBackColor(RGB(255,255,255));
                var_Item1->PutSelBackColor(RGB(255,0,0));
                var_Item1->PutSelHotBackColor(RGB(255,0,0));
                var_Item1->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight);
                var_Item1->PutRadio(VARIANT_TRUE);
                var_Item1->PutRadioGroup(100);
                var_Item1->PutChecked(VARIANT_TRUE);
            EXTOOLBARLib::IItemPtr var_Item2 = var_Items1->Add(L"Radio 2",vtMissing,vtMissing);
                var_Item2->PutHotBackColor(RGB(255,255,255));
                var_Item2->PutSelBackColor(RGB(255,0,0));
                var_Item2->PutSelHotBackColor(RGB(255,0,0));
                var_Item2->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight);
                var_Item2->PutRadio(VARIANT_TRUE);
                var_Item2->PutRadioGroup(100);
            var_Items1->Add(L"",vtMissing,vtMissing)->PutToString(_bstr_t("Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,") +
"0)]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Radio 1",TNoParam(),TNoParam());
                var_Item1->HotBackColor = RGB(255,255,255);
                var_Item1->SelBackColor = RGB(255,0,0);
                var_Item1->SelHotBackColor = RGB(255,0,0);
                var_Item1->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight;
                var_Item1->Radio = true;
                var_Item1->RadioGroup = 100;
                var_Item1->Checked = true;
            Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items1->Add(L"Radio 2",TNoParam(),TNoParam());
                var_Item2->HotBackColor = RGB(255,255,255);
                var_Item2->SelBackColor = RGB(255,0,0);
                var_Item2->SelHotBackColor = RGB(255,0,0);
                var_Item2->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight;
                var_Item2->Radio = true;
                var_Item2->RadioGroup = 100;
            var_Items1->Add(L"",TNoParam(),TNoParam())->ToString = TVariant(String("Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,") +
"0)]");
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 1",null,null);
                var_Item1.HotBackColor = Color.FromArgb(255,255,255);
                var_Item1.SelBackColor = Color.FromArgb(255,0,0);
                var_Item1.SelHotBackColor = Color.FromArgb(255,0,0);
                var_Item1.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                var_Item1.Radio = true;
                var_Item1.RadioGroup = 100;
                var_Item1.Checked = true;
            exontrol.EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Radio 2",null,null);
                var_Item2.HotBackColor = Color.FromArgb(255,255,255);
                var_Item2.SelBackColor = Color.FromArgb(255,0,0);
                var_Item2.SelHotBackColor = Color.FromArgb(255,0,0);
                var_Item2.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                var_Item2.Radio = true;
                var_Item2.RadioGroup = 100;
            var_Items1.Add("",null,null).ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," +
"0)]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Radio 1",null,null);
                    var_Item1.HotBackColor = 16777215;
                    var_Item1.SelBackColor = 255;
                    var_Item1.SelHotBackColor = 255;
                    var_Item1.ShowCheckedAsSelected = 1;
                    var_Item1.Radio = true;
                    var_Item1.RadioGroup = 100;
                    var_Item1.Checked = true;
                var var_Item2 = var_Items1.Add("Radio 2",null,null);
                    var_Item2.HotBackColor = 16777215;
                    var_Item2.SelBackColor = 255;
                    var_Item2.SelHotBackColor = 255;
                    var_Item2.ShowCheckedAsSelected = 1;
                    var_Item2.Radio = true;
                    var_Item2.RadioGroup = 100;
                var_Items1.Add("",null,null).ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," +
    "0)]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    With .Add("Radio 1")
                        .HotBackColor = RGB(255,255,255)
                        .SelBackColor = RGB(255,0,0)
                        .SelHotBackColor = RGB(255,0,0)
                        .ShowCheckedAsSelected = 1
                        .Radio = True
                        .RadioGroup = 100
                        .Checked = True
                    End With
                    With .Add("Radio 2")
                        .HotBackColor = RGB(255,255,255)
                        .SelBackColor = RGB(255,0,0)
                        .SelHotBackColor = RGB(255,0,0)
                        .ShowCheckedAsSelected = 1
                        .Radio = True
                        .RadioGroup = 100
                    End With
                    .Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," & _
    "0)]"
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 1",null,null);
                var_Item1.HotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,255,255));
                var_Item1.SelBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
                var_Item1.SelHotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
                var_Item1.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                var_Item1.Radio = true;
                var_Item1.RadioGroup = 100;
                var_Item1.Checked = true;
            EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Radio 2",null,null);
                var_Item2.HotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,255,255));
                var_Item2.SelBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
                var_Item2.SelHotBackColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
                var_Item2.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                var_Item2.Radio = true;
                var_Item2.RadioGroup = 100;
            var_Items1.Add("",null,null).ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0," +
"0)]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Item3,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1;
    str var_s;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Radio 1"); com_Item1 = var_Item1;
                    com_Item1.HotBackColor(WinApi::RGB2int(255,255,255));
                    com_Item1.SelBackColor(WinApi::RGB2int(255,0,0));
                    com_Item1.SelHotBackColor(WinApi::RGB2int(255,0,0));
                    com_Item1.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/);
                    com_Item1.Radio(true);
                    com_Item1.RadioGroup(100);
                    com_Item1.Checked(true);
                var_Item2 = com_Items1.Add("Radio 2"); com_Item2 = var_Item2;
                    com_Item2.HotBackColor(WinApi::RGB2int(255,255,255));
                    com_Item2.SelBackColor(WinApi::RGB2int(255,0,0));
                    com_Item2.SelHotBackColor(WinApi::RGB2int(255,0,0));
                    com_Item2.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/);
                    com_Item2.Radio(true);
                    com_Item2.RadioGroup(100);
                var_Item3 = COM::createFromObject(com_Items1.Add("")); com_Item3 = var_Item3;
                var_s = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0";
                var_s = var_s + ")]";
                com_Item3.ToString(var_s);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                with Add('Radio 1',Nil,Nil) do
                begin
                    HotBackColor := $ffffff;
                    SelBackColor := $ff;
                    SelHotBackColor := $ff;
                    ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                    Radio := True;
                    RadioGroup := 100;
                    Checked := True;
                end;
                with Add('Radio 2',Nil,Nil) do
                begin
                    HotBackColor := $ffffff;
                    SelBackColor := $ff;
                    SelHotBackColor := $ff;
                    ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                    Radio := True;
                    RadioGroup := 100;
                end;
                Add('',Nil,Nil).ToString := 'Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0' +
    ')]';
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                with Add('Radio 1',Null,Null) do
                begin
                    HotBackColor := $ffffff;
                    SelBackColor := $ff;
                    SelHotBackColor := $ff;
                    ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight;
                    Radio := True;
                    RadioGroup := 100;
                    Checked := True;
                end;
                with Add('Radio 2',Null,Null) do
                begin
                    HotBackColor := $ffffff;
                    SelBackColor := $ff;
                    SelHotBackColor := $ff;
                    ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight;
                    Radio := True;
                    RadioGroup := 100;
                end;
                Add('',Null,Null).ToString := 'Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0' +
    ')]';
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                with .Add("Radio 1")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = 1
                    .Radio = .T.
                    .RadioGroup = 100
                    .Checked = .T.
                endwith
                with .Add("Radio 2")
                    .HotBackColor = RGB(255,255,255)
                    .SelBackColor = RGB(255,0,0)
                    .SelHotBackColor = RGB(255,0,0)
                    .ShowCheckedAsSelected = 1
                    .Radio = .T.
                    .RadioGroup = 100
                endwith
                var_s = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0"
                var_s = var_s + ")]"
                .Add("").ToString = var_s
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Radio 1")
                var_Item1.HotBackColor = 0xffffff
                var_Item1.SelBackColor = 0xff
                var_Item1.SelHotBackColor = 0xff
                var_Item1.ShowCheckedAsSelected = 1
                var_Item1.Radio = true
                var_Item1.RadioGroup = 100
                var_Item1.Checked = true
            var_Item2 = var_Items1.Add("Radio 2")
                var_Item2.HotBackColor = 0xffffff
                var_Item2.SelBackColor = 0xff
                var_Item2.SelHotBackColor = 0xff
                var_Item2.ShowCheckedAsSelected = 1
                var_Item2.Radio = true
                var_Item2.RadioGroup = 100
            // var_Items1.Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
            var_Item3 = var_Items1.Add("")
            with (oToolBar)
                TemplateDef = [Dim var_Item3]
                TemplateDef = var_Item3
                Template = [var_Item3.ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"]
            endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Item3 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Radio 1")
                var_Item1.HotBackColor = 16777215
                var_Item1.SelBackColor = 255
                var_Item1.SelHotBackColor = 255
                var_Item1.ShowCheckedAsSelected = 1
                var_Item1.Radio = .t.
                var_Item1.RadioGroup = 100
                var_Item1.Checked = .t.
            var_Item2 = var_Items1.Add("Radio 2")
                var_Item2.HotBackColor = 16777215
                var_Item2.SelBackColor = 255
                var_Item2.SelHotBackColor = 255
                var_Item2.ShowCheckedAsSelected = 1
                var_Item2.Radio = .t.
                var_Item2.RadioGroup = 100
            ' var_Items1.Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
            var_Item3 = var_Items1.Add("")
            oToolBar.TemplateDef = "Dim var_Item3"
            oToolBar.TemplateDef = var_Item3
            oToolBar.Template = "var_Item3.ToString = \"Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]\""

oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1,var_Item2 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Radio 1",nil,nil)
                var_Item1:HotBackColor := RGB(255,255,255)
                var_Item1:SelBackColor := RGB(255,0,0)
                var_Item1:SelHotBackColor := RGB(255,0,0)
                var_Item1:ShowCheckedAsSelected := exDisplayItemHighlight
                var_Item1:Radio := true
                var_Item1:RadioGroup := 100
                var_Item1:Checked := true
            var_Item2 := var_Items1:Add("Radio 2",nil,nil)
                var_Item2:HotBackColor := RGB(255,255,255)
                var_Item2:SelBackColor := RGB(255,0,0)
                var_Item2:SelHotBackColor := RGB(255,0,0)
                var_Item2:ShowCheckedAsSelected := exDisplayItemHighlight
                var_Item2:Radio := true
                var_Item2:RadioGroup := 100
            var_Items1:Add("",nil,nil):ToString := "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Radio 1")
                var_Item1.HotBackColor = RGB(255,255,255)
                var_Item1.SelBackColor = RGB(255,0,0)
                var_Item1.SelHotBackColor = RGB(255,0,0)
                var_Item1.ShowCheckedAsSelected = 1
                var_Item1.Radio = true
                var_Item1.RadioGroup = 100
                var_Item1.Checked = true
            var_Item2 = var_Items1.Add("Radio 2")
                var_Item2.HotBackColor = RGB(255,255,255)
                var_Item2.SelBackColor = RGB(255,0,0)
                var_Item2.SelHotBackColor = RGB(255,0,0)
                var_Item2.ShowCheckedAsSelected = 1
                var_Item2.Radio = true
                var_Item2.RadioGroup = 100
            var_Items1.Add("").ToString = "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Radio 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComHotBackColor of hoItem1 to (RGB(255,255,255))
                    Set ComSelBackColor of hoItem1 to (RGB(255,0,0))
                    Set ComSelHotBackColor of hoItem1 to (RGB(255,0,0))
                    Set ComShowCheckedAsSelected of hoItem1 to OLEexDisplayItemHighlight
                    Set ComRadio of hoItem1 to True
                    Set ComRadioGroup of hoItem1 to 100
                    Set ComChecked of hoItem1 to True
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Radio 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComHotBackColor of hoItem2 to (RGB(255,255,255))
                    Set ComSelBackColor of hoItem2 to (RGB(255,0,0))
                    Set ComSelHotBackColor of hoItem2 to (RGB(255,0,0))
                    Set ComShowCheckedAsSelected of hoItem2 to OLEexDisplayItemHighlight
                    Set ComRadio of hoItem2 to True
                    Set ComRadioGroup of hoItem2 to 100
                Send Destroy to hoItem2
                Variant voItem3
                Get ComAdd of hoItems1 "" Nothing Nothing to voItem3
                Handle hoItem3
                Get Create (RefClass(cComItem)) to hoItem3
                Set pvComObject of hoItem3 to voItem3
                    Set ComToString of hoItem3 to "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
                Send Destroy to hoItem3
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1,oItem2
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Radio 1")
                        oItem1:SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
                        oItem1:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
                        oItem1:SetProperty("SelHotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
                        oItem1:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/
                        oItem1:Radio := .T.
                        oItem1:RadioGroup := 100
                        oItem1:Checked := .T.
                    oItem2 := oItems1:Add("Radio 2")
                        oItem2:SetProperty("HotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,255,255 } )  , .F. ))
                        oItem2:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
                        oItem2:SetProperty("SelHotBackColor",AutomationTranslateColor( GraMakeRGBColor  ( { 255,0,0 } )  , .F. ))
                        oItem2:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/
                        oItem2:Radio := .T.
                        oItem2:RadioGroup := 100
                    oItems1:Add(""):ToString := "Radio 3[typ=2][show=1][grp=100][bghot=RGB(255,255,255)][bgsel=RGB(255,0,0)][bgselhot=RGB(255,0,0)]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Shortcut

property Item.Shortcut as String
Specifies the key combination that the user can press to select the item quickly.

Type | Description
String | A String expression that specifies the key combination the user can select the item by keys. The shortcut should include modifier keys such as ALT, CTRL and Shift
Currently, the control supports Advanced Shortcut Keys Support, including UI visual appearance. By default, the Shortcut property is empty, which indicates that no shortcut key is associated with the item. The Shortcut property specifies the key combination that the user can press to select the item quickly. The Enabled property specifies whether the item is enabled or disabled, inclusive its shortcut key. The ShortcutKeyVisible property gets or sets a value that specifies whether the control's shortcut keys are visible or hidden. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

The Shortcut property can specify no modifier key, and so the item's shortcut became the parent's shortcut modifier plus the shortcut itself. For instance, if the parent item has the shortcut "CTRL + A", and the item's shortcut is "P", it indicates that the item's shortcut is actually "CTRL + A + P", which indicates that the item is selected as soon as the user presses the CTRL + A, and then P key. You can use this option to easily assign shortcut to items, by inheriting the parent's shortcut. At least one shortcut of any parent should have a modifier key, else the shortcut of the item itself can not be invoked.

For instance:

  • "ALT + 1", specifies that the user can press ALT then 1, or together ALT and 1
  • "CTRL + ALT + Enter", specifies that the user can press CTRL, then ALT and Enter or ALT , and then CTRL and Enter, or all together CTRL and ALT and Enter
  • "CTRL + AA" or "CTRL + A + A", specifies that the user need to press CTRL, then A and then A

The Shortcut property supports the following modifier keys ( code ):

  • SHIFT (16 or 0x10)
  • CTRL (17 or 0x11)
  • ALT (18 or 0x12)

The Shortcut property supports the following predefined keys ( code ):

  • Add (107 or 0x6B)
  • Apps (93 or 0x5D)
  • Backspace (8 or 0x08)
  • CapsLock (20 or 0x14)
  • Comma (188 or 0xBC)
  • Decimal (110 or 0x6E)
  • Delete (46 or 0x2E)
  • Divide (111 or 0x6F)
  • Down (40 or 0x28)
  • End (35 or 0x23)
  • Enter (13 or 0x0D)
  • Escape (27 or 0x1B)
  • F1 (112 or 0x70) to F24 (135 or 0x87)
  • Help (47 or 0x2F)
  • Home (36 or 0x24)
  • Insert (45 or 0x2D)
  • LWin (91 or 0x5B)
  • Left (37 or 0x25)
  • Minus (189 or 0xBD)
  • Multiply (106 or 0x6A)
  • NumLock (144 or 0x90)
  • NumPad0 (96 or 0x60) to NumPad9 (105 or 0x69)
  • OEM1 (186 or 0xBA)
  • OEM2 (191 or 0xBF)
  • OEM3 (192 or 0xC0)
  • OEM4 (219 or 0xDB)
  • OEM5 (220 or 0xDC)
  • OEM6 (221 or 0xDD)
  • OEM7 (222 or 0xDE)
  • OEM8 (223 or 0xDF)
  • PageDown (34 or 0x22)
  • PageUp (33 or 0x21)
  • Pause (19 or 0x13)
  • Period (190 or 0xBE)
  • Plus (187 or 0xBB)
  • PrintScr (44 or 0x2C)
  • RWin (92 or 0x5C)
  • Right (39 or 0x27)
  • Scroll (145 or 0x91)
  • Separator (108 or 0x6C)
  • Sleep (95 or 0x5F)
  • Space (32 or 0x20)
  • Subtract (109 or 0x6D)
  • Tab (9 or 0x09)
  • Up (38 or 0x26)

Also, any digit ( 0 - 9 ) or letter ( A - Z ) is supported.

(previously) By default, the Shortcut property is defined as first sequence found in the item's Caption between <u> and </u> HTML tags. Pressing the shortcut key is similar with selecting the item and pressing the Enter key. The shortcuts in the context menu have effect only if the PopupIncrementalSearch property is exNoIncrementalSearch.


property ShowAsButton

property Item.ShowAsButton as ShowAsButtonEnum
Specifies whether the item is shown as a button.

Type | Description
ShowAsButtonEnum | A ShowAsButtonEnum expression that indicates whether the item is shown as a button.
By default, the ShowAsButton property is False. Use the ShowAsButton property to add buttons to your item. The Caption property specifies the caption of the item/button. Use the Item's CloseOnClick property to specify a different way to close the menu when user clicks a specified item. You can use the ShowAsButton property on exShowAsSelectButton, for a popup-item, where the SubMenu property determines the sub-menu/items to be shown when user clicks the associated arrow ( select button ).

The following screen shot shows the items with no button appearance ( ShowAsButton on exShowAsButtonNone )

The following screen shot shows the items with button appearance ( ShowAsButton on exShowAsButton )

The following screen shot shows the items with button appearance ( ShowAsButton on exShowAsSelectButtonBottom )

I am using exShowAsSelectButton/exShowAsSelectButtonBottom but none of them works. What could be wrong?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Button",2)
            .ShowAsButton = 19 ' ShowAsButtonEnum.exShowAsSelectButton Or ShowAsButtonEnum.exShowAsButtonAutoSize
            With .Items
                .PopupAppearance = 6
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Button",2)
            .ShowAsButton = ShowAsButtonEnum.exShowAsSelectButton Or ShowAsButtonEnum.exShowAsButtonAutoSize
            With .Items
                .PopupAppearance = ShadowBorder
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Button",2)
            .ShowAsButton = exontrol.EXTOOLBARLib.ShowAsButtonEnum.exShowAsSelectButton Or exontrol.EXTOOLBARLib.ShowAsButtonEnum.exShowAsButtonAutoSize
            With .Items
                .PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.ShadowBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Button",2)
            .ShowAsButton = EXTOOLBARLib.ShowAsButtonEnum.exShowAsSelectButton Or EXTOOLBARLib.ShowAsButtonEnum.exShowAsButtonAutoSize
            With .Items
                .PopupAppearance = EXTOOLBARLib.AppearanceEnum.ShadowBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Button",long(2),vtMissing);
        var_Item->PutShowAsButton(EXTOOLBARLib::ShowAsButtonEnum(EXTOOLBARLib::exShowAsSelectButton | EXTOOLBARLib::exShowAsButtonAutoSize));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutPopupAppearance(EXTOOLBARLib::ShadowBorder);
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Button",TVariant(2),TNoParam());
        var_Item->ShowAsButton = Extoolbarlib_tlb::ShowAsButtonEnum::exShowAsSelectButton | Extoolbarlib_tlb::ShowAsButtonEnum::exShowAsButtonAutoSize;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::ShadowBorder;
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Button",2,null);
        var_Item.ShowAsButton = exontrol.EXTOOLBARLib.ShowAsButtonEnum.exShowAsSelectButton | exontrol.EXTOOLBARLib.ShowAsButtonEnum.exShowAsButtonAutoSize;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.ShadowBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Button",2,null);
            var_Item.ShowAsButton = 19;
            var var_Items1 = var_Item.Items;
                var_Items1.PopupAppearance = 6;
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Button",2)
                .ShowAsButton = 19 ' ShowAsButtonEnum.exShowAsSelectButton Or ShowAsButtonEnum.exShowAsButtonAutoSize
                With .Items
                    .PopupAppearance = 6
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Button",2,null);
        var_Item.ShowAsButton = EXTOOLBARLib.ShowAsButtonEnum.exShowAsSelectButton | EXTOOLBARLib.ShowAsButtonEnum.exShowAsButtonAutoSize;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = EXTOOLBARLib.AppearanceEnum.ShadowBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items,com_Items1;
    anytype var_Item,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Button",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.ShowAsButton(19/*exShowAsSelectButton | exShowAsButtonAutoSize*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.PopupAppearance(6/*ShadowBorder*/);
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Button',TObject(2),Nil) do
        begin
            ShowAsButton := Integer(EXTOOLBARLib.ShowAsButtonEnum.exShowAsSelectButton) Or Integer(EXTOOLBARLib.ShowAsButtonEnum.exShowAsButtonAutoSize);
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib.AppearanceEnum.ShadowBorder;
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Button',OleVariant(2),Null) do
        begin
            ShowAsButton := Integer(EXTOOLBARLib_TLB.exShowAsSelectButton) Or Integer(EXTOOLBARLib_TLB.exShowAsButtonAutoSize);
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib_TLB.ShadowBorder;
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Button",2)
            .ShowAsButton = 19 && ShowAsButtonEnum.exShowAsSelectButton Or ShowAsButtonEnum.exShowAsButtonAutoSize
            with .Items
                .PopupAppearance = 6
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Button",2)
        var_Item.ShowAsButton = 19 /*exShowAsSelectButton | exShowAsButtonAutoSize*/
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 6
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Button",2)
        var_Item.ShowAsButton = 19 'exShowAsSelectButton + exShowAsButtonAutoSize
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 6
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Button",2,nil)
        var_Item:ShowAsButton := exShowAsSelectButton | exShowAsButtonAutoSize
        var_Items1 := var_Item:Items
            var_Items1:PopupAppearance := ShadowBorder
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Button",2)
        var_Item.ShowAsButton = 19 /*exShowAsSelectButton | exShowAsButtonAutoSize*/
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 6
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Button" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComShowAsButton of hoItem to (OLEexShowAsSelectButton + OLEexShowAsButtonAutoSize)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComPopupAppearance of hoItems1 to OLEShadowBorder
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Button",2)
                oItem:ShowAsButton := 19/*exShowAsSelectButton+exShowAsButtonAutoSize*/
                oItems1 := oItem:Items()
                    oItems1:PopupAppearance := 6/*ShadowBorder*/
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowAsDisabled

property Item.ShowAsDisabled as Boolean
Specifies whether the item is shown as disabled.

Type | Description
Boolean | A Boolean expression that specifies whether the current item is shown as disabled.
By default, the ShowAsDisabled property is False. Use the ShowAsDisabled property to shows the current item as disabled. The Enabled property specifies whether the item is enabled or disabled. The ShowAsDisabled property does not change the Enabled property, the item acts like an enabled item. For instance, you can not highlight a disabled item, instead you can highlight an item that looks as disabled. A disabled item ( Enabled property is False) shows as grayed, and it is un-selectable, so the user can select or highlight it. An item ( Enabled property is True, ShowAsDisabled property is True ), shows as grayed, but it is selectable, so the user can select or highlight it.

How can I show the item as disabled but still be able to select or use it?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").ShowAsDisabled = True
        .Add("").ToString = "Item[showdis=1]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").ShowAsDisabled = True
        .Add("").ToString = "Item[showdis=1]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").ShowAsDisabled = True
        .Add("").ToString = "Item[showdis=1]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").ShowAsDisabled = True
        .Add("").ToString = "Item[showdis=1]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutShowAsDisabled(VARIANT_TRUE);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[showdis=1]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->ShowAsDisabled = true;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[showdis=1]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).ShowAsDisabled = true;
    var_Items.Add("",null,null).ToString = "Item[showdis=1]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).ShowAsDisabled = true;
        var_Items.Add("",null,null).ToString = "Item[showdis=1]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").ShowAsDisabled = True
            .Add("").ToString = "Item[showdis=1]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).ShowAsDisabled = true;
    var_Items.Add("",null,null).ToString = "Item[showdis=1]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.ShowAsDisabled(true);
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[showdis=1]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).ShowAsDisabled := True;
        Add('',Nil,Nil).ToString := 'Item[showdis=1]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).ShowAsDisabled := True;
        Add('',Null,Null).ToString := 'Item[showdis=1]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").ShowAsDisabled = .T.
        .Add("").ToString = "Item[showdis=1]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").ShowAsDisabled = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.ShowAsDisabled = true]
    endwith
    // var_Items.Add("").ToString = "Item[showdis=1]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[showdis=1]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").ShowAsDisabled = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.ShowAsDisabled = True"

    ' var_Items.Add("").ToString = "Item[showdis=1]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[showdis=1]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):ShowAsDisabled := true
    var_Items:Add("",nil,nil):ToString := "Item[showdis=1]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").ShowAsDisabled = true
    var_Items.Add("").ToString = "Item[showdis=1]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComShowAsDisabled of hoItem to True
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[showdis=1]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):ShowAsDisabled := .T.
            oItems:Add(""):ToString := "Item[showdis=1]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowCheckedAsSelected

property Item.ShowCheckedAsSelected as ShowCheckedAsSelectedEnum
Specifies whether the checked item shows as selected.

Type | Description
ShowCheckedAsSelectedEnum | A ShowCheckedAsSelectedEnum expression that specifies whether the checked item shows as selected.
By default, the ShowCheckedAsSelected property is exDisplayItemCheckInherit, which indicates that the control's ShowCheckedAsSelected property specifies how the checked item is shown. Use the ShowCheckedAsSelected property on non zero, to show the checked items as selected. A checked item is an item with the Check or Radio property set on True and the Checked property is True. The SelBackColor property indicates the color to show background of the selected / highlighted item. The AllowToggleRadio property on True, allows a radio button to set on zero ( unchecked ), if the user clicks twice the radio button.

The following screen shot shows the control when the ShowCheckedAsSelected property is exDisplayItemCheckDefault( by default ):

The following screen shot shows the control when the ShowCheckedAsSelected property is exDisplayItemCheckHighlight:

How can I add check-buttons to items, without showing the check-box (method 2)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = 1
                End With
                With .Add("Check 2")
                    .Check = True
                    .ShowCheckedAsSelected = 1
                End With
                With .Add("Check 3")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = 1
                End With
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = exDisplayItemHighlight
                End With
                With .Add("Check 2")
                    .Check = True
                    .ShowCheckedAsSelected = exDisplayItemHighlight
                End With
                With .Add("Check 3")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = exDisplayItemHighlight
                End With
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                End With
                With .Add("Check 2")
                    .Check = True
                    .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                End With
                With .Add("Check 3")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                End With
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                End With
                With .Add("Check 2")
                    .Check = True
                    .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                End With
                With .Add("Check 3")
                    .Check = True
                    .Checked = True
                    .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight
                End With
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",vtMissing,vtMissing);
                var_Item1->PutCheck(VARIANT_TRUE);
                var_Item1->PutChecked(VARIANT_TRUE);
                var_Item1->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight);
            EXTOOLBARLib::IItemPtr var_Item2 = var_Items1->Add(L"Check 2",vtMissing,vtMissing);
                var_Item2->PutCheck(VARIANT_TRUE);
                var_Item2->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight);
            EXTOOLBARLib::IItemPtr var_Item3 = var_Items1->Add(L"Check 3",vtMissing,vtMissing);
                var_Item3->PutCheck(VARIANT_TRUE);
                var_Item3->PutChecked(VARIANT_TRUE);
                var_Item3->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",TNoParam(),TNoParam());
                var_Item1->Check = true;
                var_Item1->Checked = true;
                var_Item1->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight;
            Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items1->Add(L"Check 2",TNoParam(),TNoParam());
                var_Item2->Check = true;
                var_Item2->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight;
            Extoolbarlib_tlb::IItemPtr var_Item3 = var_Items1->Add(L"Check 3",TNoParam(),TNoParam());
                var_Item3->Check = true;
                var_Item3->Checked = true;
                var_Item3->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
                var_Item1.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
            exontrol.EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Check 2",null,null);
                var_Item2.Check = true;
                var_Item2.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
            exontrol.EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Check 3",null,null);
                var_Item3.Check = true;
                var_Item3.Checked = true;
                var_Item3.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Check 1",null,null);
                    var_Item1.Check = true;
                    var_Item1.Checked = true;
                    var_Item1.ShowCheckedAsSelected = 1;
                var var_Item2 = var_Items1.Add("Check 2",null,null);
                    var_Item2.Check = true;
                    var_Item2.ShowCheckedAsSelected = 1;
                var var_Item3 = var_Items1.Add("Check 3",null,null);
                    var_Item3.Check = true;
                    var_Item3.Checked = true;
                    var_Item3.ShowCheckedAsSelected = 1;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    With .Add("Check 1")
                        .Check = True
                        .Checked = True
                        .ShowCheckedAsSelected = 1
                    End With
                    With .Add("Check 2")
                        .Check = True
                        .ShowCheckedAsSelected = 1
                    End With
                    With .Add("Check 3")
                        .Check = True
                        .Checked = True
                        .ShowCheckedAsSelected = 1
                    End With
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
                var_Item1.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
            EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Check 2",null,null);
                var_Item2.Check = true;
                var_Item2.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
            EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Check 3",null,null);
                var_Item3.Check = true;
                var_Item3.Checked = true;
                var_Item3.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Item3,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Check 1"); com_Item1 = var_Item1;
                    com_Item1.Check(true);
                    com_Item1.Checked(true);
                    com_Item1.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/);
                var_Item2 = com_Items1.Add("Check 2"); com_Item2 = var_Item2;
                    com_Item2.Check(true);
                    com_Item2.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/);
                var_Item3 = com_Items1.Add("Check 3"); com_Item3 = var_Item3;
                    com_Item3.Check(true);
                    com_Item3.Checked(true);
                    com_Item3.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Nil,Nil) do
                begin
                    Check := True;
                    Checked := True;
                    ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                end;
                with Add('Check 2',Nil,Nil) do
                begin
                    Check := True;
                    ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                end;
                with Add('Check 3',Nil,Nil) do
                begin
                    Check := True;
                    Checked := True;
                    ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight;
                end;
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Null,Null) do
                begin
                    Check := True;
                    Checked := True;
                    ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight;
                end;
                with Add('Check 2',Null,Null) do
                begin
                    Check := True;
                    ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight;
                end;
                with Add('Check 3',Null,Null) do
                begin
                    Check := True;
                    Checked := True;
                    ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight;
                end;
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                with .Add("Check 1")
                    .Check = .T.
                    .Checked = .T.
                    .ShowCheckedAsSelected = 1
                endwith
                with .Add("Check 2")
                    .Check = .T.
                    .ShowCheckedAsSelected = 1
                endwith
                with .Add("Check 3")
                    .Check = .T.
                    .Checked = .T.
                    .ShowCheckedAsSelected = 1
                endwith
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
                var_Item1.ShowCheckedAsSelected = 1
            var_Item2 = var_Items1.Add("Check 2")
                var_Item2.Check = true
                var_Item2.ShowCheckedAsSelected = 1
            var_Item3 = var_Items1.Add("Check 3")
                var_Item3.Check = true
                var_Item3.Checked = true
                var_Item3.ShowCheckedAsSelected = 1
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Item3 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = .t.
                var_Item1.Checked = .t.
                var_Item1.ShowCheckedAsSelected = 1
            var_Item2 = var_Items1.Add("Check 2")
                var_Item2.Check = .t.
                var_Item2.ShowCheckedAsSelected = 1
            var_Item3 = var_Items1.Add("Check 3")
                var_Item3.Check = .t.
                var_Item3.Checked = .t.
                var_Item3.ShowCheckedAsSelected = 1
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1,var_Item2,var_Item3 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Check 1",nil,nil)
                var_Item1:Check := true
                var_Item1:Checked := true
                var_Item1:ShowCheckedAsSelected := exDisplayItemHighlight
            var_Item2 := var_Items1:Add("Check 2",nil,nil)
                var_Item2:Check := true
                var_Item2:ShowCheckedAsSelected := exDisplayItemHighlight
            var_Item3 := var_Items1:Add("Check 3",nil,nil)
                var_Item3:Check := true
                var_Item3:Checked := true
                var_Item3:ShowCheckedAsSelected := exDisplayItemHighlight
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
                var_Item1.ShowCheckedAsSelected = 1
            var_Item2 = var_Items1.Add("Check 2")
                var_Item2.Check = true
                var_Item2.ShowCheckedAsSelected = 1
            var_Item3 = var_Items1.Add("Check 3")
                var_Item3.Check = true
                var_Item3.Checked = true
                var_Item3.ShowCheckedAsSelected = 1
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Check 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComCheck of hoItem1 to True
                    Set ComChecked of hoItem1 to True
                    Set ComShowCheckedAsSelected of hoItem1 to OLEexDisplayItemHighlight
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Check 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComCheck of hoItem2 to True
                    Set ComShowCheckedAsSelected of hoItem2 to OLEexDisplayItemHighlight
                Send Destroy to hoItem2
                Variant voItem3
                Get ComAdd of hoItems1 "Check 3" Nothing Nothing to voItem3
                Handle hoItem3
                Get Create (RefClass(cComItem)) to hoItem3
                Set pvComObject of hoItem3 to voItem3
                    Set ComCheck of hoItem3 to True
                    Set ComChecked of hoItem3 to True
                    Set ComShowCheckedAsSelected of hoItem3 to OLEexDisplayItemHighlight
                Send Destroy to hoItem3
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1,oItem2,oItem3
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Check 1")
                        oItem1:Check := .T.
                        oItem1:Checked := .T.
                        oItem1:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/
                    oItem2 := oItems1:Add("Check 2")
                        oItem2:Check := .T.
                        oItem2:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/
                    oItem3 := oItems1:Add("Check 3")
                        oItem3:Check := .T.
                        oItem3:Checked := .T.
                        oItem3:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowLocalPopup

property Item.ShowLocalPopup as Boolean
Specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.

Type | Description
Boolean | A Boolean expression that specifies whether the item's sub-menu is closed when user clicks an item.
By default, the ShowLocalPopup property is False. Use the ShowLocalPopup property on True, to provide drop down list. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus. The LocalAppearance property specifies a different visual appearance for the local popup. Use the CloseOnClick property to specify how to close the current popup when user clicks a specified item. The PopupAppearance specifies a different visual appearance for the current submenu.


property ShowPopupAlign

property Item.ShowPopupAlign as ShowPopupAlignEnum
Retrieves or sets a value that indicates how the item's sub-menu is aligned relative to the parent item.

Type | Description
ShowPopupAlignEnum | A ShowPopupAlignEnum expression that specifies whether the sub-menu is shown down or up to the item
By default, the ShowDown property is exShowPopupAlignDown + exShowPopupAlignRight. Use the ShowDown property to show the sub-menu up to the item. The SubMenu/Items property accesses the collection of Item objects to be shown on the sub-menu.

Is it possible to show the popup bellow to the item, rather than on the right side?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupAlign = 1
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = 1
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupAlign = exShowPopupAlignDown
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = FlatBorder
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.FlatBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = EXTOOLBARLib.AppearanceEnum.FlatBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Popup",long(2),vtMissing);
        var_Item->PutShowPopupAlign(EXTOOLBARLib::exShowPopupAlignDown);
        var_Item->PutShowPopupArrow(VARIANT_FALSE);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutPopupAppearance(EXTOOLBARLib::FlatBorder);
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Popup",TVariant(2),TNoParam());
        var_Item->ShowPopupAlign = Extoolbarlib_tlb::ShowPopupAlignEnum::exShowPopupAlignDown;
        var_Item->ShowPopupArrow = false;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::FlatBorder;
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,null);
        var_Item.ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
        var_Item.ShowPopupArrow = false;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.FlatBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Popup",2,null);
            var_Item.ShowPopupAlign = 1;
            var_Item.ShowPopupArrow = false;
            var var_Items1 = var_Item.Items;
                var_Items1.PopupAppearance = 1;
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Popup",2)
                .ShowPopupAlign = 1
                .ShowPopupArrow = False
                With .Items
                    .PopupAppearance = 1
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,null);
        var_Item.ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
        var_Item.ShowPopupArrow = false;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = EXTOOLBARLib.AppearanceEnum.FlatBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items,com_Items1;
    anytype var_Item,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Popup",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.ShowPopupAlign(1/*exShowPopupAlignDown*/);
            com_Item.ShowPopupArrow(false);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.PopupAppearance(1/*FlatBorder*/);
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Popup',TObject(2),Nil) do
        begin
            ShowPopupAlign := EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
            ShowPopupArrow := False;
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib.AppearanceEnum.FlatBorder;
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Popup',OleVariant(2),Null) do
        begin
            ShowPopupAlign := EXTOOLBARLib_TLB.exShowPopupAlignDown;
            ShowPopupArrow := False;
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib_TLB.FlatBorder;
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Popup",2)
            .ShowPopupAlign = 1
            .ShowPopupArrow = .F.
            with .Items
                .PopupAppearance = 1
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2)
        var_Item.ShowPopupAlign = 1
        var_Item.ShowPopupArrow = false
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 1
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2)
        var_Item.ShowPopupAlign = 1
        var_Item.ShowPopupArrow = .f.
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 1
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Popup",2,nil)
        var_Item:ShowPopupAlign := exShowPopupAlignDown
        var_Item:ShowPopupArrow := false
        var_Items1 := var_Item:Items
            var_Items1:PopupAppearance := FlatBorder
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2)
        var_Item.ShowPopupAlign = 1
        var_Item.ShowPopupArrow = false
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 1
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Popup" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComShowPopupAlign of hoItem to OLEexShowPopupAlignDown
            Set ComShowPopupArrow of hoItem to False
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComPopupAppearance of hoItems1 to OLEFlatBorder
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Popup",2)
                oItem:ShowPopupAlign := 1/*exShowPopupAlignDown*/
                oItem:ShowPopupArrow := .F.
                oItems1 := oItem:Items()
                    oItems1:PopupAppearance := 1/*FlatBorder*/
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowPopupArrow

property Item.ShowPopupArrow as Boolean
Gets or sets a value that indicates whether an item that has a sub-menu shows or hides its popup arrow.

Type | Description
Boolean | A Boolean expression that specifies whether the item displays the popup arrow.
By default, the ShowPopupArrow property is True. Use the ShowPopupArrow property to hide the popup's arrow on the parent item.

Is it possible to hide the popup's arrow?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = 6
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        .Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = ShadowBorder
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        .Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.ShadowBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
        .Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Popup",2)
            .ShowPopupArrow = False
            With .Items
                .PopupAppearance = EXTOOLBARLib.AppearanceEnum.ShadowBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
        .Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Popup",long(2),vtMissing);
        var_Item->PutShowPopupArrow(VARIANT_FALSE);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutPopupAppearance(EXTOOLBARLib::ShadowBorder);
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Popup",TVariant(2),TNoParam());
        var_Item->ShowPopupArrow = false;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::ShadowBorder;
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,null);
        var_Item.ShowPopupArrow = false;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.ShadowBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
    var_Items.Add("",null,null).ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Popup",2,null);
            var_Item.ShowPopupArrow = false;
            var var_Items1 = var_Item.Items;
                var_Items1.PopupAppearance = 6;
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
        var_Items.Add("",null,null).ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Popup",2)
                .ShowPopupArrow = False
                With .Items
                    .PopupAppearance = 6
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
            End With
            .Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,null);
        var_Item.ShowPopupArrow = false;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = EXTOOLBARLib.AppearanceEnum.ShadowBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
    var_Items.Add("",null,null).ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Popup",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.ShowPopupArrow(false);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.PopupAppearance(6/*ShadowBorder*/);
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
        var_Item1 = COM::createFromObject(com_Items.Add("")); com_Item1 = var_Item1;
        com_Item1.ToString("Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Popup',TObject(2),Nil) do
        begin
            ShowPopupArrow := False;
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib.AppearanceEnum.ShadowBorder;
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
        end;
        Add('',Nil,Nil).ToString := 'Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Popup',OleVariant(2),Null) do
        begin
            ShowPopupArrow := False;
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib_TLB.ShadowBorder;
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
        end;
        Add('',Null,Null).ToString := 'Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Popup",2)
            .ShowPopupArrow = .F.
            with .Items
                .PopupAppearance = 6
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
        endwith
        .Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2)
        var_Item.ShowPopupArrow = false
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 6
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    // var_Items.Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2)
        var_Item.ShowPopupArrow = .f.
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 6
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    ' var_Items.Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)\""

oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Popup",2,nil)
        var_Item:ShowPopupArrow := false
        var_Items1 := var_Item:Items
            var_Items1:PopupAppearance := ShadowBorder
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
    var_Items:Add("",nil,nil):ToString := "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2)
        var_Item.ShowPopupArrow = false
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 6
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    var_Items.Add("").ToString = "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Popup" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComShowPopupArrow of hoItem to False
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComPopupAppearance of hoItems1 to OLEShadowBorder
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Popup",2)
                oItem:ShowPopupArrow := .F.
                oItems1 := oItem:Items()
                    oItems1:PopupAppearance := 6/*ShadowBorder*/
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
            oItems:Add(""):ToString := "Popup[arrow=0][popupapp=6](Item 1,Item 2,Item 3)"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowPopupAt

property Item.ShowPopupAt as Long
Specifies the identifier of the item where the current item's submenu/popup is displayed.

Type | Description
Long | A long expression that specifies the identifier of the item where the current popup should be displayed.
By default, the ShowPopupAt property is 0. If no item with specified identifier is found, the default item is used to display its submenu. Use the ShowPopupOffset property specifies the relative offset to show the item's sub menu.

How can I display the drop down popup to a different position?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = 1
            With .Items
                With .Add("Popup 1",2,100)
                    .ShowPopupAlign = 1
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = 3
                        .Add "Item 1"
                        .Add "Item 2"
                        .Add "Item 3"
                    End With
                End With
                With .Add("Popup 2",2,200)
                    .ShowPopupAt = 100
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = 3
                        .Add "Item 4"
                        .Add "Item 5"
                        .Add "Item 6"
                    End With
                End With
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = exGroupPopup
            With .Items
                With .Add("Popup 1",2,100)
                    .ShowPopupAlign = exShowPopupAlignDown
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = RaisedBorder
                        .Add "Item 1"
                        .Add "Item 2"
                        .Add "Item 3"
                    End With
                End With
                With .Add("Popup 2",2,200)
                    .ShowPopupAt = 100
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = RaisedBorder
                        .Add "Item 4"
                        .Add "Item 5"
                        .Add "Item 6"
                    End With
                End With
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Popup 1",2,100)
                    .ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder
                        .Add("Item 1")
                        .Add("Item 2")
                        .Add("Item 3")
                    End With
                End With
                With .Add("Popup 2",2,200)
                    .ShowPopupAt = 100
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder
                        .Add("Item 4")
                        .Add("Item 5")
                        .Add("Item 6")
                    End With
                End With
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Popup 1",2,100)
                    .ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder
                        .Add("Item 1")
                        .Add("Item 2")
                        .Add("Item 3")
                    End With
                End With
                With .Add("Popup 2",2,200)
                    .ShowPopupAt = 100
                    .ShowPopupArrow = False
                    With .Items
                        .PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder
                        .Add("Item 4")
                        .Add("Item 5")
                        .Add("Item 6")
                    End With
                End With
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::exGroupPopup);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Popup 1",long(2),long(100));
                var_Item1->PutShowPopupAlign(EXTOOLBARLib::exShowPopupAlignDown);
                var_Item1->PutShowPopupArrow(VARIANT_FALSE);
                EXTOOLBARLib::IItemsPtr var_Items2 = var_Item1->GetItems();
                    var_Items2->PutPopupAppearance(EXTOOLBARLib::RaisedBorder);
                    var_Items2->Add(L"Item 1",vtMissing,vtMissing);
                    var_Items2->Add(L"Item 2",vtMissing,vtMissing);
                    var_Items2->Add(L"Item 3",vtMissing,vtMissing);
            EXTOOLBARLib::IItemPtr var_Item2 = var_Items1->Add(L"Popup 2",long(2),long(200));
                var_Item2->PutShowPopupAt(100);
                var_Item2->PutShowPopupArrow(VARIANT_FALSE);
                EXTOOLBARLib::IItemsPtr var_Items3 = var_Item2->GetItems();
                    var_Items3->PutPopupAppearance(EXTOOLBARLib::RaisedBorder);
                    var_Items3->Add(L"Item 4",vtMissing,vtMissing);
                    var_Items3->Add(L"Item 5",vtMissing,vtMissing);
                    var_Items3->Add(L"Item 6",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Popup 1",TVariant(2),TVariant(100));
                var_Item1->ShowPopupAlign = Extoolbarlib_tlb::ShowPopupAlignEnum::exShowPopupAlignDown;
                var_Item1->ShowPopupArrow = false;
                Extoolbarlib_tlb::IItemsPtr var_Items2 = var_Item1->Items;
                    var_Items2->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::RaisedBorder;
                    var_Items2->Add(L"Item 1",TNoParam(),TNoParam());
                    var_Items2->Add(L"Item 2",TNoParam(),TNoParam());
                    var_Items2->Add(L"Item 3",TNoParam(),TNoParam());
            Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items1->Add(L"Popup 2",TVariant(2),TVariant(200));
                var_Item2->ShowPopupAt = 100;
                var_Item2->ShowPopupArrow = false;
                Extoolbarlib_tlb::IItemsPtr var_Items3 = var_Item2->Items;
                    var_Items3->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::RaisedBorder;
                    var_Items3->Add(L"Item 4",TNoParam(),TNoParam());
                    var_Items3->Add(L"Item 5",TNoParam(),TNoParam());
                    var_Items3->Add(L"Item 6",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Popup 1",2,100);
                var_Item1.ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
                var_Item1.ShowPopupArrow = false;
                exontrol.EXTOOLBARLib.Items var_Items2 = var_Item1.Items;
                    var_Items2.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                    var_Items2.Add("Item 1",null,null);
                    var_Items2.Add("Item 2",null,null);
                    var_Items2.Add("Item 3",null,null);
            exontrol.EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Popup 2",2,200);
                var_Item2.ShowPopupAt = 100;
                var_Item2.ShowPopupArrow = false;
                exontrol.EXTOOLBARLib.Items var_Items3 = var_Item2.Items;
                    var_Items3.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                    var_Items3.Add("Item 4",null,null);
                    var_Items3.Add("Item 5",null,null);
                    var_Items3.Add("Item 6",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 1;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Popup 1",2,100);
                    var_Item1.ShowPopupAlign = 1;
                    var_Item1.ShowPopupArrow = false;
                    var var_Items2 = var_Item1.Items;
                        var_Items2.PopupAppearance = 3;
                        var_Items2.Add("Item 1",null,null);
                        var_Items2.Add("Item 2",null,null);
                        var_Items2.Add("Item 3",null,null);
                var var_Item2 = var_Items1.Add("Popup 2",2,200);
                    var_Item2.ShowPopupAt = 100;
                    var_Item2.ShowPopupArrow = false;
                    var var_Items3 = var_Item2.Items;
                        var_Items3.PopupAppearance = 3;
                        var_Items3.Add("Item 4",null,null);
                        var_Items3.Add("Item 5",null,null);
                        var_Items3.Add("Item 6",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("",2)
                .GroupPopup = 1
                With .Items
                    With .Add("Popup 1",2,100)
                        .ShowPopupAlign = 1
                        .ShowPopupArrow = False
                        With .Items
                            .PopupAppearance = 3
                            .Add "Item 1"
                            .Add "Item 2"
                            .Add "Item 3"
                        End With
                    End With
                    With .Add("Popup 2",2,200)
                        .ShowPopupAt = 100
                        .ShowPopupArrow = False
                        With .Items
                            .PopupAppearance = 3
                            .Add "Item 4"
                            .Add "Item 5"
                            .Add "Item 6"
                        End With
                    End With
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Popup 1",2,100);
                var_Item1.ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
                var_Item1.ShowPopupArrow = false;
                EXTOOLBARLib.Items var_Items2 = var_Item1.Items;
                    var_Items2.PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                    var_Items2.Add("Item 1",null,null);
                    var_Items2.Add("Item 2",null,null);
                    var_Items2.Add("Item 3",null,null);
            EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Popup 2",2,200);
                var_Item2.ShowPopupAt = 100;
                var_Item2.ShowPopupArrow = false;
                EXTOOLBARLib.Items var_Items3 = var_Item2.Items;
                    var_Items3.PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                    var_Items3.Add("Item 4",null,null);
                    var_Items3.Add("Item 5",null,null);
                    var_Items3.Add("Item 6",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Items,com_Items1,com_Items2,com_Items3;
    anytype var_Item,var_Item1,var_Item2,var_Items,var_Items1,var_Items2,var_Items3;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(1/*exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Popup 1",COMVariant::createFromInt(2),COMVariant::createFromInt(100)); com_Item1 = var_Item1;
                    com_Item1.ShowPopupAlign(1/*exShowPopupAlignDown*/);
                    com_Item1.ShowPopupArrow(false);
                    var_Items2 = com_Item1.Items(); com_Items2 = var_Items2;
                        com_Items2.PopupAppearance(3/*RaisedBorder*/);
                        com_Items2.Add("Item 1");
                        com_Items2.Add("Item 2");
                        com_Items2.Add("Item 3");
                var_Item2 = com_Items1.Add("Popup 2",COMVariant::createFromInt(2),COMVariant::createFromInt(200)); com_Item2 = var_Item2;
                    com_Item2.ShowPopupAt(100);
                    com_Item2.ShowPopupArrow(false);
                    var_Items3 = com_Item2.Items(); com_Items3 = var_Items3;
                        com_Items3.PopupAppearance(3/*RaisedBorder*/);
                        com_Items3.Add("Item 4");
                        com_Items3.Add("Item 5");
                        com_Items3.Add("Item 6");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
            with Items do
            begin
                with Add('Popup 1',TObject(2),TObject(100)) do
                begin
                    ShowPopupAlign := EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
                    ShowPopupArrow := False;
                    with Items do
                    begin
                        PopupAppearance := EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                        Add('Item 1',Nil,Nil);
                        Add('Item 2',Nil,Nil);
                        Add('Item 3',Nil,Nil);
                    end;
                end;
                with Add('Popup 2',TObject(2),TObject(200)) do
                begin
                    ShowPopupAt := 100;
                    ShowPopupArrow := False;
                    with Items do
                    begin
                        PopupAppearance := EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                        Add('Item 4',Nil,Nil);
                        Add('Item 5',Nil,Nil);
                        Add('Item 6',Nil,Nil);
                    end;
                end;
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := EXTOOLBARLib_TLB.exGroupPopup;
            with Items do
            begin
                with Add('Popup 1',OleVariant(2),OleVariant(100)) do
                begin
                    ShowPopupAlign := EXTOOLBARLib_TLB.exShowPopupAlignDown;
                    ShowPopupArrow := False;
                    with Items do
                    begin
                        PopupAppearance := EXTOOLBARLib_TLB.RaisedBorder;
                        Add('Item 1',Null,Null);
                        Add('Item 2',Null,Null);
                        Add('Item 3',Null,Null);
                    end;
                end;
                with Add('Popup 2',OleVariant(2),OleVariant(200)) do
                begin
                    ShowPopupAt := 100;
                    ShowPopupArrow := False;
                    with Items do
                    begin
                        PopupAppearance := EXTOOLBARLib_TLB.RaisedBorder;
                        Add('Item 4',Null,Null);
                        Add('Item 5',Null,Null);
                        Add('Item 6',Null,Null);
                    end;
                end;
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("",2)
            .GroupPopup = 1
            with .Items
                with .Add("Popup 1",2,100)
                    .ShowPopupAlign = 1
                    .ShowPopupArrow = .F.
                    with .Items
                        .PopupAppearance = 3
                        .Add("Item 1")
                        .Add("Item 2")
                        .Add("Item 3")
                    endwith
                endwith
                with .Add("Popup 2",2,200)
                    .ShowPopupAt = 100
                    .ShowPopupArrow = .F.
                    with .Items
                        .PopupAppearance = 3
                        .Add("Item 4")
                        .Add("Item 5")
                        .Add("Item 6")
                    endwith
                endwith
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items,var_Items1,var_Items2,var_Items3

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 1
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Popup 1",2,100)
                var_Item1.ShowPopupAlign = 1
                var_Item1.ShowPopupArrow = false
                var_Items2 = var_Item1.Items
                    var_Items2.PopupAppearance = 3
                    var_Items2.Add("Item 1")
                    var_Items2.Add("Item 2")
                    var_Items2.Add("Item 3")
            var_Item2 = var_Items1.Add("Popup 2",2,200)
                var_Item2.ShowPopupAt = 100
                var_Item2.ShowPopupArrow = false
                var_Items3 = var_Item2.Items
                    var_Items3.PopupAppearance = 3
                    var_Items3.Add("Item 4")
                    var_Items3.Add("Item 5")
                    var_Items3.Add("Item 6")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P
Dim var_Items1 as P
Dim var_Items2 as P
Dim var_Items3 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 1
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Popup 1",2,100)
                var_Item1.ShowPopupAlign = 1
                var_Item1.ShowPopupArrow = .f.
                var_Items2 = var_Item1.Items
                    var_Items2.PopupAppearance = 3
                    var_Items2.Add("Item 1")
                    var_Items2.Add("Item 2")
                    var_Items2.Add("Item 3")
            var_Item2 = var_Items1.Add("Popup 2",2,200)
                var_Item2.ShowPopupAt = 100
                var_Item2.ShowPopupArrow = .f.
                var_Items3 = var_Item2.Items
                    var_Items3.PopupAppearance = 3
                    var_Items3.Add("Item 4")
                    var_Items3.Add("Item 5")
                    var_Items3.Add("Item 6")
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1,var_Item2 as IItem
local var_Items,var_Items1,var_Items2,var_Items3 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Popup 1",2,100)
                var_Item1:ShowPopupAlign := exShowPopupAlignDown
                var_Item1:ShowPopupArrow := false
                var_Items2 := var_Item1:Items
                    var_Items2:PopupAppearance := RaisedBorder
                    var_Items2:Add("Item 1",nil,nil)
                    var_Items2:Add("Item 2",nil,nil)
                    var_Items2:Add("Item 3",nil,nil)
            var_Item2 := var_Items1:Add("Popup 2",2,200)
                var_Item2:ShowPopupAt := 100
                var_Item2:ShowPopupArrow := false
                var_Items3 := var_Item2:Items
                    var_Items3:PopupAppearance := RaisedBorder
                    var_Items3:Add("Item 4",nil,nil)
                    var_Items3:Add("Item 5",nil,nil)
                    var_Items3:Add("Item 6",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Items,var_Items1,var_Items2,var_Items3

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 1
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Popup 1",2,100)
                var_Item1.ShowPopupAlign = 1
                var_Item1.ShowPopupArrow = false
                var_Items2 = var_Item1.Items
                    var_Items2.PopupAppearance = 3
                    var_Items2.Add("Item 1")
                    var_Items2.Add("Item 2")
                    var_Items2.Add("Item 3")
            var_Item2 = var_Items1.Add("Popup 2",2,200)
                var_Item2.ShowPopupAt = 100
                var_Item2.ShowPopupArrow = false
                var_Items3 = var_Item2.Items
                    var_Items3.PopupAppearance = 3
                    var_Items3.Add("Item 4")
                    var_Items3.Add("Item 5")
                    var_Items3.Add("Item 6")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to OLEexGroupPopup
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Popup 1" 2 100 to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComShowPopupAlign of hoItem1 to OLEexShowPopupAlignDown
                    Set ComShowPopupArrow of hoItem1 to False
                    Variant voItems2
                    Get ComItems of hoItem1 to voItems2
                    Handle hoItems2
                    Get Create (RefClass(cComItems)) to hoItems2
                    Set pvComObject of hoItems2 to voItems2
                        Set ComPopupAppearance of hoItems2 to OLERaisedBorder
                        Get ComAdd of hoItems2 "Item 1" Nothing Nothing to Nothing
                        Get ComAdd of hoItems2 "Item 2" Nothing Nothing to Nothing
                        Get ComAdd of hoItems2 "Item 3" Nothing Nothing to Nothing
                    Send Destroy to hoItems2
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Popup 2" 2 200 to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComShowPopupAt of hoItem2 to 100
                    Set ComShowPopupArrow of hoItem2 to False
                    Variant voItems3
                    Get ComItems of hoItem2 to voItems3
                    Handle hoItems3
                    Get Create (RefClass(cComItems)) to hoItems3
                    Set pvComObject of hoItems3 to voItems3
                        Set ComPopupAppearance of hoItems3 to OLERaisedBorder
                        Get ComAdd of hoItems3 "Item 4" Nothing Nothing to Nothing
                        Get ComAdd of hoItems3 "Item 5" Nothing Nothing to Nothing
                        Get ComAdd of hoItems3 "Item 6" Nothing Nothing to Nothing
                    Send Destroy to hoItems3
                Send Destroy to hoItem2
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1,oItem2
    LOCAL oItems,oItems1,oItems2,oItems3
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 1/*exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Popup 1",2,100)
                        oItem1:ShowPopupAlign := 1/*exShowPopupAlignDown*/
                        oItem1:ShowPopupArrow := .F.
                        oItems2 := oItem1:Items()
                            oItems2:PopupAppearance := 3/*RaisedBorder*/
                            oItems2:Add("Item 1")
                            oItems2:Add("Item 2")
                            oItems2:Add("Item 3")
                    oItem2 := oItems1:Add("Popup 2",2,200)
                        oItem2:ShowPopupAt := 100
                        oItem2:ShowPopupArrow := .F.
                        oItems3 := oItem2:Items()
                            oItems3:PopupAppearance := 3/*RaisedBorder*/
                            oItems3:Add("Item 4")
                            oItems3:Add("Item 5")
                            oItems3:Add("Item 6")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowPopupOffset

property Item.ShowPopupOffset as String
Specifies the offset (horizontal,vertical) to display the item's submenu/popup relative to its default position.

Type Description
String A String expression that specifies the offset as a pair (horizontal, vertical) to display the item's submenu/popup relative to its default position.

The horizontal/vertical can be one of the following:

  • number, indicating the x,y-offset relative to default position of the drop down panel. The number can be can be followed by a D character which indicates that the coordinate is giving in dots, rather than pixels, and depends on the current DPI settings. For instance, ShowPopupOffset = "12D,12D", indicates that the inner popup is moved by 18,18 pixels if the DPI settings is 150%, while if DPI settings is 100% the popup is moved by 12,12 pixels, relative to its current position. The numberD converted in pixels is number * DPI / 100.
  • number:control, indicating the x,y-offset relative to control.
  • number:screen, indicating the x,y-absolute position on the screen.
By default, the ShowPopupOffset property is empty ( equivalent with the "0,0" ). The ShowPopupOffset property specifies the offset as a pair (horizontal,vertical) to display the item's submenu/popup relative to its default position/control or screen. Use the ShowPopupAt property to specify the identifier of the item where the current item's submenu/popup is displayed.

For instance, the following sample, displays the item's drop down relative to the control ( call ShowPopupOffset ):

With ToolBar1
    .PopupAppearance = ShadowBorder
    With .Items
        With .Add("Popup <b>1",2,100)
            .ShowPopupArrow = False
            .ShowPopupAlign = exShowPopupAlignDown
            .ShowPopupOffset = "0,0:control"
            With .Items
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        With .Add("Popup <b>2",2,200)
            .GroupPopup = exGroupPopup
            With .Items
                .Add "Item 2"
                .Add "Item 3"
                .Add "Item 4"
            End With
        End With
    End With
    .Refresh
End With

and we get:

while following sample displays the item's drop down at its default position ( no ShowPopupOffset call, default ):

With ToolBar1
    .PopupAppearance = ShadowBorder
    With .Items
        With .Add("Popup <b>1",2,100)
            .ShowPopupArrow = False
            .ShowPopupAlign = exShowPopupAlignDown
            .ShowPopupOffset = "0,0:control"
            With .Items
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        With .Add("Popup <b>2",2,200)
            .GroupPopup = exGroupPopup
            With .Items
                .Add "Item 2"
                .Add "Item 3"
                .Add "Item 4"
            End With
        End With
    End With
    .Refresh
End With

and we get:

How can I display the drop down popup to a different position?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Popup",2,100)
            .ShowPopupAlign = 1
            .ShowPopupArrow = False
            .ShowPopupOffset = "-12,-48"
            With .Items
                .PopupAppearance = 3
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Popup",2,100)
            .ShowPopupAlign = exShowPopupAlignDown
            .ShowPopupArrow = False
            .ShowPopupOffset = "-12,-48"
            With .Items
                .PopupAppearance = RaisedBorder
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Popup",2,100)
            .ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
            .ShowPopupArrow = False
            .ShowPopupOffset = "-12,-48"
            With .Items
                .PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Popup",2,100)
            .ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown
            .ShowPopupArrow = False
            .ShowPopupOffset = "-12,-48"
            With .Items
                .PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Popup",long(2),long(100));
        var_Item->PutShowPopupAlign(EXTOOLBARLib::exShowPopupAlignDown);
        var_Item->PutShowPopupArrow(VARIANT_FALSE);
        var_Item->PutShowPopupOffset(L"-12,-48");
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutPopupAppearance(EXTOOLBARLib::RaisedBorder);
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Popup",TVariant(2),TVariant(100));
        var_Item->ShowPopupAlign = Extoolbarlib_tlb::ShowPopupAlignEnum::exShowPopupAlignDown;
        var_Item->ShowPopupArrow = false;
        var_Item->ShowPopupOffset = L"-12,-48";
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->PopupAppearance = Extoolbarlib_tlb::AppearanceEnum::RaisedBorder;
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,100);
        var_Item.ShowPopupAlign = exontrol.EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
        var_Item.ShowPopupArrow = false;
        var_Item.ShowPopupOffset = "-12,-48";
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = exontrol.EXTOOLBARLib.AppearanceEnum.RaisedBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Popup",2,100);
            var_Item.ShowPopupAlign = 1;
            var_Item.ShowPopupArrow = false;
            var_Item.ShowPopupOffset = "-12,-48";
            var var_Items1 = var_Item.Items;
                var_Items1.PopupAppearance = 3;
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Popup",2,100)
                .ShowPopupAlign = 1
                .ShowPopupArrow = False
                .ShowPopupOffset = "-12,-48"
                With .Items
                    .PopupAppearance = 3
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Popup",2,100);
        var_Item.ShowPopupAlign = EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
        var_Item.ShowPopupArrow = false;
        var_Item.ShowPopupOffset = "-12,-48";
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.PopupAppearance = EXTOOLBARLib.AppearanceEnum.RaisedBorder;
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items,com_Items1;
    anytype var_Item,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Popup",COMVariant::createFromInt(2),COMVariant::createFromInt(100)); com_Item = var_Item;
            com_Item.ShowPopupAlign(1/*exShowPopupAlignDown*/);
            com_Item.ShowPopupArrow(false);
            com_Item.ShowPopupOffset("-12,-48");
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.PopupAppearance(3/*RaisedBorder*/);
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Popup',TObject(2),TObject(100)) do
        begin
            ShowPopupAlign := EXTOOLBARLib.ShowPopupAlignEnum.exShowPopupAlignDown;
            ShowPopupArrow := False;
            ShowPopupOffset := '-12,-48';
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib.AppearanceEnum.RaisedBorder;
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Popup',OleVariant(2),OleVariant(100)) do
        begin
            ShowPopupAlign := EXTOOLBARLib_TLB.exShowPopupAlignDown;
            ShowPopupArrow := False;
            ShowPopupOffset := '-12,-48';
            with Items do
            begin
                PopupAppearance := EXTOOLBARLib_TLB.RaisedBorder;
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Popup",2,100)
            .ShowPopupAlign = 1
            .ShowPopupArrow = .F.
            .ShowPopupOffset = "-12,-48"
            with .Items
                .PopupAppearance = 3
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2,100)
        var_Item.ShowPopupAlign = 1
        var_Item.ShowPopupArrow = false
        var_Item.ShowPopupOffset = "-12,-48"
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 3
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2,100)
        var_Item.ShowPopupAlign = 1
        var_Item.ShowPopupArrow = .f.
        var_Item.ShowPopupOffset = "-12,-48"
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 3
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Popup",2,100)
        var_Item:ShowPopupAlign := exShowPopupAlignDown
        var_Item:ShowPopupArrow := false
        var_Item:ShowPopupOffset := "-12,-48"
        var_Items1 := var_Item:Items
            var_Items1:PopupAppearance := RaisedBorder
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Popup",2,100)
        var_Item.ShowPopupAlign = 1
        var_Item.ShowPopupArrow = false
        var_Item.ShowPopupOffset = "-12,-48"
        var_Items1 = var_Item.Items
            var_Items1.PopupAppearance = 3
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Popup" 2 100 to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComShowPopupAlign of hoItem to OLEexShowPopupAlignDown
            Set ComShowPopupArrow of hoItem to False
            Set ComShowPopupOffset of hoItem to "-12,-48"
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComPopupAppearance of hoItems1 to OLERaisedBorder
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Popup",2,100)
                oItem:ShowPopupAlign := 1/*exShowPopupAlignDown*/
                oItem:ShowPopupArrow := .F.
                oItem:ShowPopupOffset := "-12,-48"
                oItems1 := oItem:Items()
                    oItems1:PopupAppearance := 3/*RaisedBorder*/
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ShowPopupOnChecked

property Item.ShowPopupOnChecked as Boolean
Specifies whether the item's sub menu is shown only if the item is checked.

Type | Description
Boolean | A Boolean expression that specifies whether the item's sub menu is shown only if the item is checked.
By default, the ShowPopupOnChecked property is False. The Check property assigns a check box to the current item. The SubMenu property specifies the sub-items of the current item. The ShowPopupOnChecked property has effect only if the item displays sub items ( the SubMenu.Count property is not zero ). The ShowCheckedAsSelected property specifies how the checked item is displayed.

The following screen shot show items with ShowPopupOnChecked on False ( default ) ( please notice that all items display the popup-arrow ):

The following screen shot show items with ShowPopupOnChecked on True ( please notice that just checked popup displays the popup-arrow, and so the sub-menu ):

Is it possible to expand an item when it is clicked (tree,group,vertical)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = 259 ' GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical Or exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical Or EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Expand",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exGroupPopupVertical | EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        var_Item->PutCheck(VARIANT_TRUE);
        var_Item->PutShowPopupOnChecked(VARIANT_TRUE);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutPadding(L"22,0,0,0");
            var_Items1->Add(L"Radio 1",vtMissing,vtMissing)->PutRadio(VARIANT_TRUE);
            var_Items1->Add(L"Radio 2",vtMissing,vtMissing)->PutRadio(VARIANT_TRUE);
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Radio 3",vtMissing,vtMissing);
                var_Item1->PutRadio(VARIANT_TRUE);
                var_Item1->PutChecked(VARIANT_TRUE);
        var_Item->PutChecked(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Expand",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exGroupPopupVertical | Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        var_Item->Check = true;
        var_Item->ShowPopupOnChecked = true;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->Padding = L"22,0,0,0";
            var_Items1->Add(L"Radio 1",TNoParam(),TNoParam())->Radio = true;
            var_Items1->Add(L"Radio 2",TNoParam(),TNoParam())->Radio = true;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Radio 3",TNoParam(),TNoParam());
                var_Item1->Radio = true;
                var_Item1->Checked = true;
        var_Item->Checked = true;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Expand",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical | exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        var_Item.Check = true;
        var_Item.ShowPopupOnChecked = true;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.Padding = "22,0,0,0";
            var_Items1.Add("Radio 1",null,null).Radio = true;
            var_Items1.Add("Radio 2",null,null).Radio = true;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 3",null,null);
                var_Item1.Radio = true;
                var_Item1.Checked = true;
        var_Item.Checked = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Expand",2,null);
            var_Item.GroupPopup = 259;
            var_Item.Check = true;
            var_Item.ShowPopupOnChecked = true;
            var var_Items1 = var_Item.Items;
                var_Items1.Padding = "22,0,0,0";
                var_Items1.Add("Radio 1",null,null).Radio = true;
                var_Items1.Add("Radio 2",null,null).Radio = true;
                var var_Item1 = var_Items1.Add("Radio 3",null,null);
                    var_Item1.Radio = true;
                    var_Item1.Checked = true;
            var_Item.Checked = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Expand",2)
                .GroupPopup = 259 ' GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                .Check = True
                .ShowPopupOnChecked = True
                With .Items
                    .Padding = "22,0,0,0"
                    .Add("Radio 1").Radio = True
                    .Add("Radio 2").Radio = True
                    With .Add("Radio 3")
                        .Radio = True
                        .Checked = True
                    End With
                End With
                .Checked = True
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Expand",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical | EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        var_Item.Check = true;
        var_Item.ShowPopupOnChecked = true;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.Padding = "22,0,0,0";
            var_Items1.Add("Radio 1",null,null).Radio = true;
            var_Items1.Add("Radio 2",null,null).Radio = true;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 3",null,null);
                var_Item1.Radio = true;
                var_Item1.Checked = true;
        var_Item.Checked = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Expand",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(259/*exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup*/);
            com_Item.Check(true);
            com_Item.ShowPopupOnChecked(true);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.Padding("22,0,0,0");
                var_Item1 = COM::createFromObject(com_Items1.Add("Radio 1")); com_Item1 = var_Item1;
                com_Item1.Radio(true);
                var_Item1 = COM::createFromObject(com_Items1.Add("Radio 2")); com_Item1 = var_Item1;
                com_Item1.Radio(true);
                var_Item1 = com_Items1.Add("Radio 3"); com_Item1 = var_Item1;
                    com_Item1.Radio(true);
                    com_Item1.Checked(true);
            com_Item.Checked(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Expand',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical) Or Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            Check := True;
            ShowPopupOnChecked := True;
            with Items do
            begin
                Padding := '22,0,0,0';
                Add('Radio 1',Nil,Nil).Radio := True;
                Add('Radio 2',Nil,Nil).Radio := True;
                with Add('Radio 3',Nil,Nil) do
                begin
                    Radio := True;
                    Checked := True;
                end;
            end;
            Checked := True;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Expand',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exGroupPopupVertical) Or Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            Check := True;
            ShowPopupOnChecked := True;
            with Items do
            begin
                Padding := '22,0,0,0';
                Add('Radio 1',Null,Null).Radio := True;
                Add('Radio 2',Null,Null).Radio := True;
                with Add('Radio 3',Null,Null) do
                begin
                    Radio := True;
                    Checked := True;
                end;
            end;
            Checked := True;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Expand",2)
            .GroupPopup = 259 && GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            .Check = .T.
            .ShowPopupOnChecked = .T.
            with .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = .T.
                .Add("Radio 2").Radio = .T.
                with .Add("Radio 3")
                    .Radio = .T.
                    .Checked = .T.
                endwith
            endwith
            .Checked = .T.
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Expand",2)
        var_Item.GroupPopup = 259 /*exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup*/
        var_Item.Check = true
        var_Item.ShowPopupOnChecked = true
        var_Items1 = var_Item.Items
            var_Items1.Padding = "22,0,0,0"
            // var_Items1.Add("Radio 1").Radio = true
            var_Item1 = var_Items1.Add("Radio 1")
            with (oToolBar)
                TemplateDef = [Dim var_Item1]
                TemplateDef = var_Item1
                Template = [var_Item1.Radio = true]
            endwith
            // var_Items1.Add("Radio 2").Radio = true
            var_Item2 = var_Items1.Add("Radio 2")
            with (oToolBar)
                TemplateDef = [Dim var_Item2]
                TemplateDef = var_Item2
                Template = [var_Item2.Radio = true]
            endwith
            var_Item3 = var_Items1.Add("Radio 3")
                var_Item3.Radio = true
                var_Item3.Checked = true
        var_Item.Checked = true
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Item3 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Expand",2)
        var_Item.GroupPopup = 259 'exGroupPopupVertical + exNoGroupPopupFrame + exGroupPopup
        var_Item.Check = .t.
        var_Item.ShowPopupOnChecked = .t.
        var_Items1 = var_Item.Items
            var_Items1.Padding = "22,0,0,0"
            ' var_Items1.Add("Radio 1").Radio = .t.
            var_Item1 = var_Items1.Add("Radio 1")
            oToolBar.TemplateDef = "Dim var_Item1"
            oToolBar.TemplateDef = var_Item1
            oToolBar.Template = "var_Item1.Radio = True"

            ' var_Items1.Add("Radio 2").Radio = .t.
            var_Item2 = var_Items1.Add("Radio 2")
            oToolBar.TemplateDef = "Dim var_Item2"
            oToolBar.TemplateDef = var_Item2
            oToolBar.Template = "var_Item2.Radio = True"

            var_Item3 = var_Items1.Add("Radio 3")
                var_Item3.Radio = .t.
                var_Item3.Checked = .t.
        var_Item.Checked = .t.
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Expand",2,nil)
        var_Item:GroupPopup := exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup
        var_Item:Check := true
        var_Item:ShowPopupOnChecked := true
        var_Items1 := var_Item:Items
            var_Items1:Padding := "22,0,0,0"
            var_Items1:Add("Radio 1",nil,nil):Radio := true
            var_Items1:Add("Radio 2",nil,nil):Radio := true
            var_Item1 := var_Items1:Add("Radio 3",nil,nil)
                var_Item1:Radio := true
                var_Item1:Checked := true
        var_Item:Checked := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Expand",2)
        var_Item.GroupPopup = 259 /*exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup*/
        var_Item.Check = true
        var_Item.ShowPopupOnChecked = true
        var_Items1 = var_Item.Items
            var_Items1.Padding = "22,0,0,0"
            var_Items1.Add("Radio 1").Radio = true
            var_Items1.Add("Radio 2").Radio = true
            var_Item1 = var_Items1.Add("Radio 3")
                var_Item1.Radio = true
                var_Item1.Checked = true
        var_Item.Checked = true
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Expand" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexGroupPopupVertical + OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Set ComCheck of hoItem to True
            Set ComShowPopupOnChecked of hoItem to True
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComPadding of hoItems1 to "22,0,0,0"
                Variant voItem1
                Get ComAdd of hoItems1 "Radio 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComRadio of hoItem1 to True
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Radio 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComRadio of hoItem2 to True
                Send Destroy to hoItem2
                Variant voItem3
                Get ComAdd of hoItems1 "Radio 3" Nothing Nothing to voItem3
                Handle hoItem3
                Get Create (RefClass(cComItem)) to hoItem3
                Set pvComObject of hoItem3 to voItem3
                    Set ComRadio of hoItem3 to True
                    Set ComChecked of hoItem3 to True
                Send Destroy to hoItem3
            Send Destroy to hoItems1
            Set ComChecked of hoItem to True
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Expand",2)
                oItem:GroupPopup := 259/*exGroupPopupVertical+exNoGroupPopupFrame+exGroupPopup*/
                oItem:Check := .T.
                oItem:ShowPopupOnChecked := .T.
                oItems1 := oItem:Items()
                    oItems1:Padding := "22,0,0,0"
                    oItems1:Add("Radio 1"):Radio := .T.
                    oItems1:Add("Radio 2"):Radio := .T.
                    oItem1 := oItems1:Add("Radio 3")
                        oItem1:Radio := .T.
                        oItem1:Checked := .T.
                oItem:Checked := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Strikeout

property Item.Strikeout as Boolean
Specifies whether the item's caption should appear in strikeout.

Type | Description
Boolean | A Boolean expression that specifies whether the item's caption is shown in strikeout.
By default, the Strikeout property is False. Use the Strikeout property to show the item's caption in strikeout. The Caption property indicates the HTML caption to be shown on the item. The <s> HTML tag can be used on the item's Caption property to specify different parts of the caption to be shown in strikeout.

How can I show the item as strikeout?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").Strikeout = True
        .Add "<s>Item</s>"
        .Add("").ToString = "Item[stk]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").Strikeout = True
        .Add "<s>Item</s>"
        .Add("").ToString = "Item[stk]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").Strikeout = True
        .Add("<s>Item</s>")
        .Add("").ToString = "Item[stk]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").Strikeout = True
        .Add("<s>Item</s>")
        .Add("").ToString = "Item[stk]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutStrikeout(VARIANT_TRUE);
    var_Items->Add(L"<s>Item</s>",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[stk]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Strikeout = true;
    var_Items->Add(L"<s>Item</s>",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[stk]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Strikeout = true;
    var_Items.Add("<s>Item</s>",null,null);
    var_Items.Add("",null,null).ToString = "Item[stk]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Strikeout = true;
        var_Items.Add("<s>Item</s>",null,null);
        var_Items.Add("",null,null).ToString = "Item[stk]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Strikeout = True
            .Add "<s>Item</s>"
            .Add("").ToString = "Item[stk]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Strikeout = true;
    var_Items.Add("<s>Item</s>",null,null);
    var_Items.Add("",null,null).ToString = "Item[stk]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Strikeout(true);
        com_Items.Add("<s>Item</s>");
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[stk]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Strikeout := True;
        Add('<s>Item</s>',Nil,Nil);
        Add('',Nil,Nil).ToString := 'Item[stk]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Strikeout := True;
        Add('<s>Item</s>',Null,Null);
        Add('',Null,Null).ToString := 'Item[stk]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").Strikeout = .T.
        .Add("<s>Item</s>")
        .Add("").ToString = "Item[stk]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Strikeout = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Strikeout = true]
    endwith
    var_Items.Add("<s>Item</s>")
    // var_Items.Add("").ToString = "Item[stk]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[stk]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Strikeout = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Strikeout = True"

    var_Items.Add("<s>Item</s>")
    ' var_Items.Add("").ToString = "Item[stk]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[stk]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Strikeout := true
    var_Items:Add("<s>Item</s>",nil,nil)
    var_Items:Add("",nil,nil):ToString := "Item[stk]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Strikeout = true
    var_Items.Add("<s>Item</s>")
    var_Items.Add("").ToString = "Item[stk]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComStrikeout of hoItem to True
        Send Destroy to hoItem
        Get ComAdd of hoItems "<s>Item</s>" Nothing Nothing to Nothing
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[stk]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):Strikeout := .T.
            oItems:Add("<s>Item</s>")
            oItems:Add(""):ToString := "Item[stk]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property SubControl

property Item.SubControl as Control
Retrieves the Control object that holds information about item's inside component.

Type | Description
Control | A Control object that holds properties to handle the inside ActiveX item.

Use the SubControl property when using the ItemTypeEnum.SubControl to add an item that hosts an ActiveX inside. Use the ControlID property to specify the IDentifier of the object to be displayed on the item. Use the Create method to create an inside ActiveX control. The inside ActiveX control fires the events through the OleEvent event.

The following screen shot displays an item with an ExCalendar inside:

The following samples shows how to load an ActiveX control ( Exontrol.Calendar )

VBA (MS Access, Excell...)

With ToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create()
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create()
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IControlPtr var_Control = spToolBar1->GetItems()->Add(L"Calendar",long(3),vtMissing)->GetSubControl();
    var_Control->PutWidth(256);
    var_Control->PutHeight(256);
    var_Control->PutControlID(L"Exontrol.Calendar");
    var_Control->Create();
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IControlPtr var_Control = ToolBar1->Items->Add(L"Calendar",TVariant(3),TNoParam())->SubControl;
    var_Control->Width = 256;
    var_Control->Height = 256;
    var_Control->ControlID = L"Exontrol.Calendar";
    var_Control->Create();
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Control var_Control = extoolbar1.Items.Add("Calendar",3,null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 256;
    var_Control.ControlID = "Exontrol.Calendar";
    var_Control.Create();
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Control = ToolBar1.Items.Add("Calendar",3,null).SubControl;
        var_Control.Width = 256;
        var_Control.Height = 256;
        var_Control.ControlID = "Exontrol.Calendar";
        var_Control.Create();
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items.Add("Calendar",3).SubControl
            .Width = 256
            .Height = 256
            .ControlID = "Exontrol.Calendar"
            .Create
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Control var_Control = axToolBar1.Items.Add("Calendar",3,null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 256;
    var_Control.ControlID = "Exontrol.Calendar";
    var_Control.Create();
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Control,com_Item;
    anytype var_Control,var_Item;
    ;

    super();

    var_Item = COM::createFromObject(extoolbar1.Items()).Add("Calendar",COMVariant::createFromInt(3)); com_Item = var_Item;
    var_Control = com_Item.SubControl(); com_Control = var_Control;
        com_Control.Width(256);
        com_Control.Height(256);
        com_Control.ControlID("Exontrol.Calendar");
        com_Control.Create();
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items.Add('Calendar',TObject(3),Nil).SubControl do
    begin
        Width := 256;
        Height := 256;
        ControlID := 'Exontrol.Calendar';
        Create();
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items.Add('Calendar',OleVariant(3),Null).SubControl do
    begin
        Width := 256;
        Height := 256;
        ControlID := 'Exontrol.Calendar';
        Create();
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Control

oToolBar = form.Activex1.nativeObject
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Control as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

Visual Objects

local var_Control as IControl

var_Control := oDCOCX_Exontrol1:Items:Add("Calendar",3,nil):SubControl
    var_Control:Width := 256
    var_Control:Height := 256
    var_Control:ControlID := "Exontrol.Calendar"
    var_Control:Create()
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Control

oToolBar = ole_1.Object
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Calendar" 3 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Variant voControl
            Get ComSubControl of hoItem to voControl
            Handle hoControl
            Get Create (RefClass(cComControl)) to hoControl
            Set pvComObject of hoControl to voControl
                Set ComWidth of hoControl to 256
                Set ComHeight of hoControl to 256
                Set ComControlID of hoControl to "Exontrol.Calendar"
                Send ComCreate of hoControl
            Send Destroy to hoControl
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oControl
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oControl := oToolBar:Items():Add("Calendar",3):SubControl()
            oControl:Width := 256
            oControl:Height := 256
            oControl:ControlID := "Exontrol.Calendar"
            oControl:Create()
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property SubMenu

property Item.SubMenu as Items
Retrieves an Items collection that indicates the item's sub menu. Retrieves Nothing, if the item contains no sub menu.

Type | Description
Items | An Items collection that holds the Item objects to be displayed in the sub-menu.
The Items and SubMenu properties are equivalents. Use the SubMenu property to access the Item objects in a sub-menu item. The Parent property of the Item object returns an empty object, if the item contains no parent. The Parent item property can be used to access the parent of the item, when it is contained by a sub-menu.


property Tab

property Item.Tab as Long
Specifies the identifier of the item/tab where the current group popup is shown instead.

Type | Description
Long | A Long expression that specifies the identifier of the item where the grouping items of the current item is shown.


property Tooltip

property Item.Tooltip as String
Specifies the item's tooltip.

Type | Description
String | A String expression that defines the HTML caption to be displayed when the cursor hovers the item.
The Tooltip property assigns a HTML tooltip to an item, that's displayed only when the cursor hovers the item. The TooltipTitle property specifies the title for the item's tooltip. The TooltipDelay property specifies the time until the tooltip is shown. Use the ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. Use the ToolTipWidth property to specify the width of the tooltip window. The ToolTipFont property specifies the tooltip's font. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color.

The ToolTip property supports the following HTML tags:

  • <b> ... </b> displays the text in bold
  • <i> ... </i> displays the text in italics
  • <u> ... </u> underlines the text
  • <s> ... </s> Strike-through text
  • <a id;options> ... </a> displays an anchor element that can be clicked. An anchor is a piece of text or some other object (for example an image) which marks the beginning and/or the end of a hypertext link.The <a> element is used to mark that piece of text (or inline image), and to give its hypertextual relationship to other documents. The control fires the AnchorClick(AnchorID, Options) event when the user clicks the anchor element. The FormatAnchor property customizes the visual effect for anchor elements.
  • <font face;size> ... </font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor rrggbb> ... </fgcolor> or <fgcolor=rrggbb> ... </fgcolor> displays text with a specified foreground color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <bgcolor rrggbb> ... </bgcolor> or <bgcolor=rrggbb> ... </bgcolor> displays text with a specified background color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <solidline rrggbb> ... </solidline> or <solidline=rrggbb> ... </solidline> draws a solid-line on the bottom side of the current text-line, of specified RGB color. The <solidline> ... </solidline> draws a black solid-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <dotline rrggbb> ... </dotline> or <dotline=rrggbb> ... </dotline> draws a dot-line on the bottom side of the current text-line, of specified RGB color. The <dotline> ... </dotline> draws a black dot-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <upline> ... </upline> draws the line on the top side of the current text-line (requires <solidline> or <dotline>).
  • <r> right aligns the text
  • <c> centers the text
  • <br> forces a line-break
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number; ( the character with specified code ), For instance, the &#8364; displays the EUR character. The & ampersand is only recognized as markup when it is followed by a known letter or a #character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;
  • <off offset> ... </off> defines the vertical offset to display the text/element. The offset parameter defines the offset to display the element. This tag is inheritable, so the offset is keep while the associated </off> tag is found. You can use the <off offset> HTML tag in combination with the <font face;size> to define a smaller or a larger font to be displayed. For instance: Text with <font ;7><off 6>subscript displays the text such as: Text with subscript The Text with <font ;7><off -6>superscript displays the text such as: Text with subscript
  • <gra rrggbb;mode;blend> ... </gra> defines a gradient text. The text color or <fgcolor> defines the starting gradient color, while the rr/gg/bb represents the red/green/blue values of the ending color, 808080 if missing as gray. The mode is a value between 0 and 4, 1 if missing, and blend could be 0 or 1, 0 if missing. The <font> HTML tag can be used to define the height of the font. Any of the rrggbb, mode or blend field may not be specified. The <gra> with no fields, shows a vertical gradient color from the current text color to gray (808080). For instance the <font ;18><gra FFFFFF;1;1>gradient-center</gra></font> generates the following picture:
  • <out rrggbb;width> ... </out> shows the text with outlined characters, where rr/gg/bb represents the red/green/blue values of the outline color, 808080 if missing as gray, width indicates the size of the outline, 1 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><out 000000><fgcolor=FFFFFF>outlined</fgcolor></out></font> generates the following picture:
  • <sha rrggbb;width;offset> ... </sha> define a text with a shadow, where rr/gg/bb represents the red/green/blue values of the shadow color, 808080 if missing as gray, width indicates the size of shadow, 4 if missing, and offset indicates the offset from the origin to display the text's shadow, 2 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><sha>shadow</sha></font> generates the following picture:

    or <font ;31><sha 404040;5;0><fgcolor=FFFFFF>outline anti-aliasing</fgcolor></sha></font> gets:


property TooltipTitle

property Item.TooltipTitle as String
Specifies the title of the item's tooltip.

Type | Description
String | A String expression that specifies the title of the item's tooltip.
The TooltipTitle property specifies the title for the item's tooltip. The Tooltip property assigns a HTML tooltip to an item, that's displayed only when the cursor hovers the item. The TooltipDelay property specifies the time until the tooltip is shown. Use the ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. Use the ToolTipWidth property to specify the width of the tooltip window. The ToolTipFont property specifies the tooltip's font. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color.

How can I assign a tooltip to an item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items.Add("ToolTip")
        .TooltipTitle = "Title"
        .Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items.Add("ToolTip")
        .TooltipTitle = "Title"
        .Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items.Add("ToolTip")
        .TooltipTitle = "Title"
        .Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items.Add("ToolTip")
        .TooltipTitle = "Title"
        .Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemPtr var_Item = spToolBar1->GetItems()->Add(L"ToolTip",vtMissing,vtMissing);
    var_Item->PutTooltipTitle(L"Title");
    var_Item->PutTooltip(L"This is a bit of text that should be shown when cursor hovers the item");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemPtr var_Item = ToolBar1->Items->Add(L"ToolTip",TNoParam(),TNoParam());
    var_Item->TooltipTitle = L"Title";
    var_Item->Tooltip = L"This is a bit of text that should be shown when cursor hovers the item";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Item var_Item = extoolbar1.Items.Add("ToolTip",null,null);
    var_Item.TooltipTitle = "Title";
    var_Item.Tooltip = "This is a bit of text that should be shown when cursor hovers the item";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Item = ToolBar1.Items.Add("ToolTip",null,null);
        var_Item.TooltipTitle = "Title";
        var_Item.Tooltip = "This is a bit of text that should be shown when cursor hovers the item";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items.Add("ToolTip")
            .TooltipTitle = "Title"
            .Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Item var_Item = axToolBar1.Items.Add("ToolTip",null,null);
    var_Item.TooltipTitle = "Title";
    var_Item.Tooltip = "This is a bit of text that should be shown when cursor hovers the item";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item;
    anytype var_Item;
    ;

    super();

    var_Item = COM::createFromObject(extoolbar1.Items()).Add("ToolTip"); com_Item = var_Item;
        com_Item.TooltipTitle("Title");
        com_Item.Tooltip("This is a bit of text that should be shown when cursor hovers the item");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items.Add('ToolTip',Nil,Nil) do
    begin
        TooltipTitle := 'Title';
        Tooltip := 'This is a bit of text that should be shown when cursor hovers the item';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items.Add('ToolTip',Null,Null) do
    begin
        TooltipTitle := 'Title';
        Tooltip := 'This is a bit of text that should be shown when cursor hovers the item';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items.Add("ToolTip")
        .TooltipTitle = "Title"
        .Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item

oToolBar = form.Activex1.nativeObject
var_Item = oToolBar.Items.Add("ToolTip")
    var_Item.TooltipTitle = "Title"
    var_Item.Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Item = oToolBar.Items.Add("ToolTip")
    var_Item.TooltipTitle = "Title"
    var_Item.Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
oToolBar.Refresh()

Visual Objects

local var_Item as IItem

var_Item := oDCOCX_Exontrol1:Items:Add("ToolTip",nil,nil)
    var_Item:TooltipTitle := "Title"
    var_Item:Tooltip := "This is a bit of text that should be shown when cursor hovers the item"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item

oToolBar = ole_1.Object
var_Item = oToolBar.Items.Add("ToolTip")
    var_Item.TooltipTitle = "Title"
    var_Item.Tooltip = "This is a bit of text that should be shown when cursor hovers the item"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "ToolTip" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComTooltipTitle of hoItem to "Title"
            Set ComTooltip of hoItem to "This is a bit of text that should be shown when cursor hovers the item"
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItem := oToolBar:Items():Add("ToolTip")
            oItem:TooltipTitle := "Title"
            oItem:Tooltip := "This is a bit of text that should be shown when cursor hovers the item"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property ToString

property Item.ToString as String
Loads or saves the item using string representation.

Type | Description
String | A String expression that specifies the item to be loaded/saved.

The ToString property of the Items object, builds the control/toolbar using a string, rather than adding item one by one. The control's setup installs the WYSIWYG EditToolBar Tool, that helps you to define the ToString format.

The ToString property looks like follows:

[id=10][group=0x03]([id=10][group=0x03][itemspad=4,4,4,4][itemsbghot=0x1F000000](  Annoyed1[id=20],  Bunny2[id=30],[id=50][edittype=0x01][editwidth=-100],  Cellphone3[id=40]),[id=10][group=0x03][itemspad=4,4,4,4][itemsbghot=0x1F000000](  Annoyed1[id=20],  Bunny2[id=30],  Cellphone3[id=40]))

Each item is followed by its options, and its sub-items between () parentheses. The item's option includes the icons, pictures, edit attributes and so on.

The ToString syntax in BNF notation:

<ToString> ::= <ITEMS>
<ITEMS> ::= <ITEM>["("<ITEMS>")"][","<ITEMS>]
<ITEM> ::= <CAPTION>[<OPTIONS>]
<OPTIONS> ::= "["<OPTION>"]"["["<OPTIONS>"]"]
<OPTION> ::= <PROPERTY>["="<VALUE>]
<PROPERTY> ::= "img" | "himg" | "sep" | "id" | "typ" | "group" | "chk" | "button" | "align" | "spchk" | "show" | "rad" | "dis" | "showdis" | "bld" | "itl" | "stk" | "und" | "bg" | "fg" | "edittype" | "edit" | "mask" | "border" | "editwidth" | "captionwidth" | "height" | "grp" | "tfi" | "ttp" | "min" | "max" | "tick" | "freq" | "ticklabel" | "small" | "large" | "spin" | "ettp" | "float" | "close" | "local" | "popupapp" | "itemspad" | "itemsbg" | "itemsbghot" | "itemsbgext" | "visible" | "tab" | "pad" | "bghot" | "bgsel" | "bgselhot" | "arrow" | "popupalign" | "popupoffset" | "popupat"| "hid"

where the <CAPTION> is the HTML caption to be shown on the context menu item. The <VALUE> indicates the value of giving property.

  • id=<VALUE>, where <VALUE> is an integer expression, that indicates the identifier of the item.
  • bg=<VALUE>, specifies the item's background color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bghot=<VALUE>, specifies the item's background color, while the cursor hovers the item, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bgsel=<VALUE>, specifies the item's background color, while the item is checked/selected, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bgselhot=<VALUE>, specifies the item's background color, while the item is checked/selected and the cursor hovers it, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • fg=<VALUE>, specifies the item's foreground color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or a integer expression.
  • sep, specifies an separator item
  • dis, specifies a disabled item
  • hid, specifies a hidden item
  • showdis=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the item shows as disabled, but it is still enabled
  • bld, specifies that the item appears in bold
  • itl, specifies that the item appears in italics
  • stk, specifies that the item appears as strikeout
  • und, specifies that the item is underlined
  • align=<VALUE>, where <VALUE> could be one of the following:
    • 0 ( left ), to align the item's caption to the left
    • 1 ( center ), to center the item's caption
    • 2 ( right ), to align the item's caption to the right
  • captionwidth=<VALUE>, specifies the width to show the HTML caption of the item. where <VALUE> could be a integer expression. A negative value indicates that no limitation is applied to the item's caption, so no truncate caption is shown
  • height=<VALUE>, specifies the height to show the item, where <VALUE> could be a positive integer expression
  • pad=<VALUE>, specifies the padding (space between the menu border and the item content) to display the item. The <VALUE> is a list of coordinates such as left,top,right,bottom
  • img=<VALUE>, where <VALUE> is an integer expression, that indicates the index of the icon being displayed for the item.
  • himg=<VALUE>, where <VALUE> indicates the key of the picture to be displayed for the item.

  • typ=<VALUE>, where <VALUE> could be one of the following:
    • 0 for default/regular items ( no check/radio button is associated with the item ),
    • 1 for items that display a check/box (chk),
    • 2 to display radio buttons (rad)
  • chk[=<VALUE>], where <VALUE> could be 0 for unchecked, or not zero for checked. The chk option makes the item to display a check box. If the <VALUE> is missing the item still displays an un-checked check box.
  • rad=<VALUE>, where <VALUE> could be 0 for unchecked radio button or not zero to for checked radio button. Use the grp option to define the group of radio where this button should be associated, If no group of radio buttons is required, the grp could be ignored.
  • grp=<VALUE>, defines the radio group. It should be used when you define more groups of radio buttons. A group of radio buttons means that only one item could be checked at one time. The rad option specifies that the item displays a radio button. Use the grp option to define the group of radio where this button should be associated, If no group of radio buttons is required, the grp could be ignored. The <VALUE> could be any integer expression.

  • show=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the checked item shows as selected
  • spchk=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the item's sub menu is shown only if the item is checked.

  • group=<VALUE>, where <VALUE> could be a bit-or combination (+) of the following values:
    • 0 (exNoGroupPopup), No grouping is performed on the sub-menu, so the sub-items are shown to a float popup,
    • 1 (exGroupPopup), Groups and displays the sub-menu items on the current item, arranged from left to right/horizontally
    • 2 (exNoGroupPopupFrame), Prevents showing the frame around each grouping item.
    • 4 (exGroupPopupCenter), Shows the grouping popup aligned to the center of the current item.
    • 8 (exGroupPopupRight), Shows the grouping popup aligned to the right of the current item.
    • 16 (exGroupPopupEqualWidth), Shows the items that make the group of the same width
    • 32 (exGroupPopupEqualHeight), Shows the items that make the group of the same height
    • 64 (exGroupPopupFrameSolidBox), Shows a solid frame around the grouped items
    • 128 (exGroupPopupFrameThickBox), Shows a solid thick-frame around the grouped items
    • 256 (exGroupPopupVertical), Groups and displays the sub-menu items on the current item, arranged from top to bottom/vertically

  • button=<VALUE>, where <VALUE> could be a bit-or combination (+) of the following values.
    • 0 (exShowAsButtonNone), No button is shown,
    • 1 (exShowAsButton), Shows the item as a button
    • 2 (exShowAsButtonAutoSize), Fits the button to cover the item's caption instead showing on the entire item
    • 17 (exShowAsSelectButton), Shows the item as a select button, which is composed by two-fields, one indicates the default button, while the second field specifies the drop down button that displays the items in the current's sub-menu collection. The drop down button is shown to the right-side of the default button. The item must have a submenu, else no drop down is displayed.
    • 273 (exShowAsSelectButtonBottom), Shows the item as a select button, which is composed by two-fields, one indicates the default button, while the second field specifies the drop down button that displays the items in the current's sub-menu collection. The drop down button is shown to the bottom-side of the default button. The item must have a submenu, else no drop down is displayed.

  • ttp=<VALUE>, defines the item's tooltip. The <VALUE> could be any HTML string expression. The item's tooltip is shown when the user hovers the item.

  • edittype=<VALUE>, associates an edit field to the item, where <VALUE> could be a combination of one or more of the following values:
    • 0 ( exItemDisableEdit ), No editor is assigned to the current item.
    • 1 ( exItemEditText ), A text-box editor is assigned to the current item.
    • 2 ( exItemEditMask ), A masked text-box editor is assigned to the current item.
    • 3 ( exItemEditSlider ), A slider editor is assigned to the current item. This can be combined with 1024.
    • 4 ( exItemEditProgress ), A progress editor is assigned to the current item. This can be combined with 1024.
    • 5 ( exItemEditScrollBar ), A scrollbar editor is assigned to the current item. This can be combined with 1024.
    • 6 ( exItemEditColor), A color editor is assigned to the current item.
    • 7 ( exItemEditFont ), A font editor is assigned to the current item.
    • 256 (exItemEditReadOnly), specifies that the item's editor is shown as disabled. This value could be combined with one of the values from 0 to 7 or 512
    • 512 ( exItemEditSpin ), A spin editor is assigned to the current item. This value could be combined with one of the values from 0 to 7 or 256
    • 1024 ( exItemEditVertical ), The editor is shown vertically rather than horizontally. This value has effect for exItemEditSlider, exItemEditProgress or exItemEditScrollBar
  • edit=<VALUE>, specifies the caption to be shown in the item's edit field, where <VALUE> could be any string
  • mask=<VALUE>, specifies the mask to be applied on a masked editor. This option is valid for exItemEditMask edit. Use the float option to allow masking floating point numbers. See Masking for more information about <VALUE> of the mask option. See Masking Float for more information about <VALUE> if the float option is used.
  • float=<VALUE>, Specifies whether the mask field masks a floating point number. This option is valid for exItemEditMask edit. See Masking Float for more information about <VALUE> of mask option, if the float option is used. The <VALUE> could be 0 for standard masking field or not zero to specify that the field is masking a floating point.
  • border=<VALUE>, specifies the border to be shown on the item's edit field, where <VALUE> could be one of the following:
    • 0 ( exEditBorderNone), No border is shown.
    • -1 (exEditBorderInset), shows an inset border
    • 1 (exEditBorderSingle), shows a frame border
  • editwidth=<VALUE>, specifies the width to show the edit field inside the item, where <VALUE> could be a integer expression. A negative value indicates that the field goes to the end of the item
  • min=<VALUE>, defines the minimum value of the edit field. The <VALUE> could be any integer expression, and specifies the minimum value for any slider, progress, scroll, spin, or range editor.
  • max=<VALUE>, defines the maximum value of the edit field. The <VALUE> could be any integer expression, and specifies the maximum value for any slider, progress, scroll, spin, or range editor.
  • tick=<VALUE>, defines where the ticks of the slider edit appear. This option is valid for exItemEditSlider edit. The <VALUE> could be one of the following values:
    • 0 ( exBottomRight ), The ticks are displayed on the bottom/right side.
    • 1 ( exTopLeft ), The ticks are displayed on the top/left side.
    • 2 ( exBoth ), The ticks are displayed on the both side.
    • 3 ( exNoTicks ), No ticks are displayed.
  • freq=<VALUE>, indicates the ratio of ticks on the slider edit. This option is valid for exItemEditSlider edit. The <VALUE> could be a positive integer expression.
  • ticklabel=<VALUE>, indicates the HTML label to be displayed on slider's ticks. This option is valid for exItemEditSlider edit. See Tick Label Expression for more information about <VALUE> of the ticklabel option.
  • small=<VALUE>, indicates the amount by which the edit's position changes when the user presses the arrow key ( left, right, or button ). This option is valid for exItemEditSlider, exItemEditScrollBar edit. The <VALUE> could be a positive integer expression.
  • large=<VALUE>, indicates the amount by which the edit's position changes when the user presses the CTRL + arrow key ( CTRL + left, CTRL + right). This option is valid for exItemEditSlider, exItemEditScrollBar edit. The <VALUE> could be a positive integer expression.
  • spin=<VALUE>, specifies the step to advance when user clicks the editor's spin.. This option is valid for exItemEditSpin edit. The <VALUE> could be a positive integer expression.
  • ettp=<VALUE>, specifies the HTML tooltip to be shown when the item's value is changed. This option is valid for exItemEditSlider/exItemEditScrollBar edit. The <VALUE> could be any string expression, including built-in HTML tags
  • arrow=<VALUE>. The <VALUE> could be 0 for hiding the arrow or not zero to show the arrow. Indicates whether an item that has a sub-menu shows or hides its popup arrow. If the <VALUE> is missing, the item shows no arrow.
  • local=<VALUE>. The <VALUE> could be 0 for standard popup or not zero to specify that the field is a local popup. Specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.
  • close=<VALUE>, Specifies the way the hosting menu is closed when the user clicks the item. If the close flag is missing, the <VALUE> is 3 (exCloseOnNonClickable), by default. The <VALUE> could be one of the following values:
    • 0 ( exCloseOnClick ), The popup menu is closing when the user clicks the item.
    • 1 ( exCloseOnDblClick ), The popup menu is closing when the user double clicks the item.
    • 2 ( exCloseOnClickOutside ), The popup menu is closing when the user clicks outside of the menu.
    • 3 ( exCloseOnNonClickable ), The popup menu is closing when the user clicks a non-clickable item ( regular items ). The non-clickable items is any item that's not a separator, popup, disabled or check or radio items, clicking a check-box item will makes the check box to change its state instead closing the context menu.
  • popupapp=<VALUE> indicates the visual appearance of the item's submenu when the popup is shown. The <VALUE> could be a predefine value like shown bellow, or an integer expression that refers an EBN object.
    • 0 ( NoBorder )
    • 1 ( FlatBorder )
    • 2 ( SunkenBorder )
    • 3 ( RaisedBorder )
    • 4 ( EtchedBorder )
    • 5 ( BumpBorder )
    • 6 ( ShadowBorder )
    • 7 ( InsetBorder )
    • 8 ( SingleBorder )
  • itemsbg=<VALUE>, specifies the items background color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • itemsbghot=<VALUE>, specifies the items background color, while the cursor hovers the items, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • popupalign=<VALUE>, Indicates how the item's sub-menu is aligned relative to the parent item. The popupalign has no effect for an item that displays a select- button. The <VALUE> could be a combination of one or more of the following values:
    • 0 ( exShowPopupAlignNone ), The popup menu is shown on top of the item, aligned to the left ( no down and right, so up and left )
    • 1 ( exShowPopupAlignDown ), The popup menu is shown down. If missing, the popup menu is shown up.
    • 2 ( exShowPopupAlignRight ), The popup menu is shown aligned to the right, else if missing, the popup menu is shown aligned to the left.
  • popupat=<VALUE>, specifies the identifier of the item where the current item's submenu/popup is displayed. The <VALUE> could be any integer expression. If there is no identifier with giving value, the option has no effect.
  • popupoffset=<VALUE>, specifies the offset (horizontal,vertical) to display the item's submenu/popup relative to its default position.
  • itemspad=<VALUE>, specifies the padding (space between the menu border and the item content) to display the items. The <VALUE> is a list of coordinates such as left,top,right,bottom
  • visible=<VALUE>, specifies the maximum number of visible items at one time, where the <VALUE> could be any integer expression.
  • tab=<VALUE>, specifies the identifier of the item/tab where the current group-popup is shown instead. The <VALUE> could be any integer expression. If there is no identifier with giving value, the option has no effect.
  • itemsbgext=<VALUE>, indicates additional colors, text, images that can be displayed on the items background using the EBN String Format. The <VALUE> should be in EBN String Format. For instance, [itemsbgext=bottom[2],bottom[16,text=`</fgcolor><fgcolor 6D6AAA>Views</fgcolor><fgcolor A0A0A0>`,align=0x21]], shows the Views aligned to the bottom, with a different foreground color.

Masking, (mask option)

For instance, the following input-mask ( ext-phone )

!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid character,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."

indicates the following:

  • The pattern should contain 3 optional digits 999, and 7 required digits 000 0000, aligned to the right, !.
  • The second part of the input mask indicates 1, which means that all literals are included when the user leaves the field.
  • The entire field is selected when it receives the focus, select=1
  • The field supports empty value, so the user can leave the field with no content
  • The field enters in overtype mode, and insert-type mode is not allowed when user pressed the Insert key
  • If the user enters any invalid character, a warning tooltip with the message "invalid character" is displayed.
  • If the user tries to leave the field, while the field is not validated ( all 7 required digits completed ), the invalid tooltip is shown with the message "The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." The <%mask%> is replaced with the first part of the input mask !(999) 000 0000

The four parts of an input mask, or the Mask property supports up to four parts, separated by a semicolon (;). For instance, "`Time: `00:00:00;;0;overtype,warning=<fgcolor FF0000>invalid character,beep", indicates the pattern "00:00" with the prefix Time:, the masking character being the 0, instead _, the field enters in over-type mode, insert-type mode is not allowed, and the field beeps and displays a tooltip in red with the message invalid character when the user enters an invalid character.

Input masks are made up one mandatory part and three optional parts, and each part is separated by a semicolon (;). If a part should use the semicolon (;) it must uses the \; instead

The purpose of each part is as follows:

  1. The first part (pattern) is mandatory. It includes the mask characters or string (series of characters) along with placeholders and literal data such as, parentheses, periods, and hyphens.

    The following table lists the placeholder and literal characters for an input mask and explains how it controls data entry:

    • #, a digit, +, - or space (entry not required).
    • 0, a digit (0 through 9, entry required; plus [+] and minus [-] signs not allowed).
    • 9, a digit or space (entry not required; plus and minus signs not allowed).
    • x, a lower case hexa character, [0-9],[a-f] ( entry required )
    • X, an upper case hexa character, [0-9],[A-F] ( entry required )
    • A, any letter, digit (entry required).
    • a, any letter, digit or space (entry optional).
    • L, any letter (entry require).
    • ?, any letter or space (entry optional).
    • &, any character or a space (entry required).
    • C, any character or a space (entry optional).
    • >, any letter, converted to uppercase (entry required).
    • <, any letter, converted to lowercase (entry required).
    • *, any characters combinations
    • { min,max } (Range), indicates a number range. The syntax {min,max} (Range), masks a number in the giving range. The min and max values should be positive integers. For instance the mask {0,255} masks any number between 0 and 255.
    • [...] (Alternative), masks any characters that are contained in the [] brackets. For instance, the [abcdA-D] mask any character: a,b,c,d,A,B,C,D
    • \, indicates the escape character
    • », ( ALT + 175 ) causes the characters that follow to be converted to uppercase, until «( ALT + 174 ) is found.
    • «, ( ALT + 174 ) causes the characters that follow to be converted to lowercase, until »( ALT + 175 ) is found.
    • !, causes the input mask to fill from right to left instead of from left to right.

    Characters enclosed in double quotation ("" or ``) marks will be displayed literally. If this part should display/use the semicolon (;) character is should be included between double quotation ("" or ``) characters or as \; ( escape ).

  2. The second part is optional and refers to the embedded mask characters and how they are stored within the field. If the second part is set to 0 ( default, exClipModeLiteralsNone ), all characters are stored with the data, and if it is set to 1 (exClipModeLiteralsInclude), the literals are stored, not including the masking/placeholder characters, if 2 (exClipModeLiteralsExclude), just typed characters are stored, if 3(exClipModeLiteralsEscape), optional, required, editable and escaped entities are included. No double quoted text is included.
  3. The third part of the input mask is also optional and indicates a single character or space that is used as a placeholder. By default, the field uses the underscore (_). If you want to use another character, enter it in the third part of your mask. Only the first character is considered. If this part should display/use the semicolon (;) character is should be \; ( escape )
  4. The forth part of the input, indicates a list of options that can be applied to input mask, separated by comma(,) character.

    The known options for the forth part are:

    • float, indicates that the field is edited as a decimal number, integer. The first part of the input mask specifies the pattern to be used for grouping and decimal separators, and - if negative numbers are supported. If the first part is empty, the float is formatted as indicated by current regional settings. For instance, "##;;;float" specifies a 2 digit number in float format. The grouping, decimal, negative and digits options are valid if the float option is present.

    • grouping=value, Character used to separate groups of digits to the left of the decimal. Valid only if float is present. For instance ";;;float,grouping=" indicates that no grouping is applied to the decimal number (LOCALE_STHOUSAND)
    • decimal=value, Character used for the decimal separator. Valid only if float is present. For instance ";;;float,grouping= ,decimal=\," indicates that the decimal number uses the space for grouping digits to the left, while for decimal separator the comma character is used (LOCALE_SDECIMAL)
    • negative=value, indicates whether the decimal number supports negative numbers. The value should be 0 or 1. 1 means negative numbers are allowed. Else 0 or missing, the negative numbers are not accepted. Valid only if float is present.
    • digits=value, indicates the max number of fractional digits placed after the decimal separator. Valid only if float is present. For instance, ";;;float,digits=4" indicates a max 4 digits after decimal separator (LOCALE_IDIGITS)
    • password[=value], displays a black circle for any shown character. For instance, ";;;password", specifies that the field to be displayed as a password. If the value parameter is present, the first character in the value indicates the password character to be used. By default, the * password character is used for non-TrueType fonts, else the black circle character is used. For instance, ";;;password=*", specifies that the field to be displayed as a password, and use the * for password character. If the value parameter is missing, the default password character is used.
    • right, aligns the characters to the right. For instance, "(999) 999-9999;;;right" displays and masks a telephone number aligned to the right. readonly, the editor is locked, user can not update the content, the caret is available, so user can copy the text, excepts the password fields.
    • inserttype, indicates that the field enters in insert-type mode, if this is the first option found. If the forth part includes also the overtype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;inserttype,overtype", indicates that the field enter in insert-type mode, and over-type mode is allowed. The "##:##;;0;inserttype", indicates that the field enter in insert-type mode, and over-type mode is not allowed.
    • overtype, indicates that the field enters in over-type mode, if this is the first option found. If the forth part includes also the inserttype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;overtype,inserttype", indicates that the field enter in over-type mode, and insert-type mode is allowed. The "##:##;;0;overtype", indicates that the field enter in over-type mode, and insert-type mode is not allowed.
    • nocontext, indicates that the field provides no context menu when user right clicks the field. For instance, ";;;password,nocontext" displays a password field, where the user can not invoke the default context menu, usually when a right click occurs.
    • beep, indicates whether a beep is played once the user enters an invalid character. For instance, "00:00;;;beep" plays a beep once the user types in invalid character, in this case any character that's not a digit.
    • warning=value, indicates the html message to be shown when the user enters an invalid character. For instance, "00:00:00;;;warning=invalid character" displays a "invalid character" tooltip once the user types in invalid character, in this case any character that's not a digit. The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape )
    • invalid=value, indicates the html message to be displayed when the user enters an inappropriate value for the field. If the value is missing or empty, the option has no effect, so no validation is performed. If the value is a not-empty value, the validation is performed. If the value is single space, no message is displayed and the field is keep opened while the value is inappropriate. For instance, "!(999) 000 0000;;;invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." displays the "The value you entered isn't appropriate for the input mask '...' specified for this field." tooltip once the user leaves the field and it is not-valid ( for instance, the field includes entities required and uncompleted ). The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape ). This option can be combined with empty, validateas.
    • validateas=value, specifies the additional validation is done for the current field. If value is missing or 0 (exValidateAsNone), the option has no effect. The validateas option has effect only if the invalid option specifies a not-empty value. Currently, the value can be 1 (exValidateAsDate), which indicates that the field is validated as a date. For instance, having the mask "!00/00/0000;;0;empty,validateas=1,invalid=Invalid date!,warning=Invalid character!,select=4,overtype", indicates that the field is validate as date ( validateas=1 ).
    • empty, indicates whether the field supports empty values. This option can be used with invalid flag, which indicates that the user can leave the field if it is empty. If empty flag is present, the field displays nothing if no entity is completed ( empty ). Once the user starts typing characters the current mask is displayed. For instance, having the mask "!(999) 000 0000;;;empty,select=4,overtype,invalid=invalid phone number,beep", it specifies an empty or valid phone to be entered.
    • select=value, indicates what to select from the field when it got the focus. The value could be 0 ( nothing, exSelectNoGotFocus ), 1 ( select all, exSelectAllGotFocus ), 2 ( select the first empty and editable entity of the field, exSelectEditableGotFocus ), 3 ( moves the cursor to the beginning of the first empty and editable entity of the field, exMoveEditableGotFocus ), 4 ( select the first empty, required and editable entity of the field, exSelectRequiredEditableGotFocus ), 5 ( moves the cursor to the beginning of the first empty, required and editable entity of the field, exMoveRequiredEditableGotFocus ). For modes 2 and 4 the entire field is selected if no matching entity is found. For instance, "`Time:`XX:XX;;;select=1" indicates that the entire field ( including the Time: prefix ) is selected once it get the focus. The "`Time:`XX:XX;;;select=3", moves the cursor to first X, if empty, the second if empty, and so on

Experimental:
multiline, specifies that the field supports multiple lines.
rich, specifies that the field displays a rich type editor. By default, the standard edit field is shown
disabled, shows as disabled the field.

Masking-Float, (mask, float option)

The [mask=<VALUE>] property may indicate the followings, if the [float=-1] is present
  • negative number: if the first character in the mask is - ( minus ) the control supports negative numbers. Pressing the - key will toggle the sign of the number. The + sign is never displayed.
  • decimal symbol: the last character that's different than # ( digit ), or 0 (zero) indicates the decimal symbol. If it is not present the control mask a floating point number without decimals.
  • thousand symbol: the thousand symbol is the last character that's not a # ( digit ), 0 (zero) or it is not the decimal symbol as explained earlier, if present.
  • the maximum number of decimals in the number ( the # or 0 character after the decimal symbol )
  • the maximum number of digits in the integer part ( the number of # or 0 character before decimal symbol )
  • the 0 character indicates a leading-zero. The count of 0 (zero) characters before decimal character indicates the leading-zero for integer part of the control, while the count of 0 (zero) characters after the decimal separator indicates the leading-zero for decimal part of the control. For instance, the Mask on "-###,###,##0.00", while the control's Text property is 1, the control displays 1.00, if 1.1 if displays 1.10, and if empty, the 0.00 is displayed.

If the <VALUE> property is empty, the control takes the settings for the regional options like: Decimal Symbol , No. of digits after decimal, Digit grouping symbol.

Here are few samples:

The <VALUE>"-###.###.##0,00" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator ). This format displays leading-zeros.

The <VALUE>"-###.###.###,##" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator )

The <VALUE>"-###,###,###.##" filter floating point numbers a number for English settings ( "." is the decimal sign, "," is the thousands separator )

The <VALUE>"####" indicates a max-4 digit number ( positive ) without a decimal symbol and without digit grouping

The <VALUE>"-##.#" filters a floating point number from the -99.9 to 99.9 ( "." is the decimal sign, no thousands separator )

The <VALUE>"#,###.##" filters a floating point number from the 0 to 9,999.99 with digit grouping ( "." is the decimal sign, "," is the thousands separator ).

Tick Label Expression, (ticklabel option)

For instance:

  • "value", shows the values for each tick.
  • " (value=current ? '<font ;12><fgcolor=FF0000>' : '' ) + value", shows the current slider's position with a different color and font.
  • "value = current ? value : ''", shows the value for the current tick only.
  • "( value = current ? '<b><font ;10>' : '' ) + (value array 'ab bc cd de ef fg gh hi ij jk kl' split ' ')" displays different captions for slider's values.

The The <VALUE> of [ticklabel] option is a formatted expression which result may include the HTML tags.

The The <VALUE> of [ticklabel] option indicates a formatting expression that may use the following predefined keywords:

  • value gets the slider's position to be displayed
  • current gets the current slider's value.
  • vmin gets the slider's minimum value.
  • vmax gets the slider's maximum value.
  • smin gets the slider's selection minimum value.
  • smax gets the slider's selection maximum value.

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for is

"expression ? true_part : false_part"

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

"expression array (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')".

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

"expression in (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

"expression switch (default,c1,c2,c3,...,cn)"

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:

    • #4/1/2009#, from hours 06:00 AM to 12:00 PM
    • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
    • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.

Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%0) = 8 specifies the cells that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string
  • dbl (unary operator) converts the expression to a number
  • date (unary operator) converts the expression to a date, based on your regional settings
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS.

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string
  • lower (unary operator) returns a string expression in lowercase letters
  • upper (unary operator) returns a string expression in uppercase letters
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names
  • ltrim (unary operator) removes spaces on the left side of a string
  • rtrim (unary operator) removes spaces on the right side of a string
  • trim (unary operator) removes spaces on both sides of a string
  • startwith (binary operator) specifies whether a string starts with specified string
  • endwith (binary operator) specifies whether a string ends with specified string
  • contains (binary operator) specifies whether a string contains another specified string
  • left (binary operator) retrieves the left part of the string
  • right (binary operator) retrieves the right part of the string
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on )
  • a count b (binary operator) retrieves the number of occurrences of the b in a
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result.
  • a split b, splits the a using the separator b, and returns an array. For instance, the "weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' '" gets the weekday as string. This operator can be used with the array

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel.
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance the timeF(1:23 PM) returns "13:23:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel.
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance the shortdateF(December 31, 1971 11:00 AM) returns "12/31/1971".
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format.
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel.
  • year (unary operator) retrieves the year of the date (100,...,9999)
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 )
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 )
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 )
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday )
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 )
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 )
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 )

The The <VALUE> of [ticklabel] option can display labels using the following built-in HTML tags:

  • <b>…</b> displays the text in bold.
  • <i>…</i> displays the text in italics.
  • <u>…</u> underlines the text.
  • <s>…</s> Strike-through text
  • <font face;size>…</font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor=RRGGBB>…</fgcolor> displays text with a specified foreground color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <bgcolor=RRGGBB>…</bgcolor> displays text with a specified background color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <br> a forced line-break
  • <solidline> The next line shows a solid-line on top/bottom side. If has no effect for a single line caption.
  • <dotline> The next line shows a dot-line on top/bottom side. If has no effect for a single line caption.
  • <upline> The next line shows a solid/dot-line on top side. If has no effect for a single line caption.
  • <r> Right aligns the text
  • <c> Centers the text
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number ( the character with specified code ), For instance, the &#8364 displays the EUR character, in UNICODE configuration. The & ampersand is only recognized as markup when it is followed by a known letter or a # character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;

EBN String Format, (itemsbgext option)

The EBN String Format syntax in BNF notation is defined like follows:

<EBN> ::= <elements> | <root> "(" [<elements>] ")"
<elements> ::= <element> [ "," <elements> ]
<root> ::= "root" [ <attributes> ] | [ <attributes> ]
<element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ]
<anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom"
<attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]"
<client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression>
<expression> ::= <number> | <number> "%"
<attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others>
<equal> ::= "="
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<decimal> ::= <digit><decimal>
<hexadigit> ::= <digit> | "A" | "B"  "C" | "D" | "E"  "F"
<hexa> ::= <hexadigit><hexa>
<number> ::= <decimal> | "0x" <hexa>
<color> ::= <rgbcolor> | number
<rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")"
<string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> "
<characters> ::= <char>|<characters>
<char> ::= <any_character_excepts_null>
<backcolor> ::= "back" <equal> <color>
<text> ::= "text" <equal> <string>
<align> ::= "align" <equal> <number>
<pattern> ::= "pattern" <equal> <number>
<patterncolor> ::= "patterncolor" <equal> <color>
<frame> ::= "frame" <equal> <color>
<data> ::= "data" <equal> <number> | <string>
<framethick> ::= "framethick"
<wordwrap> ::= "wordwrap"

Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.

Here's a few easy samples:

  • "[pattern=6]", shows the BDiagonal pattern on the object's background.

  • "[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.

  • "[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.

  • "[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:

  • "top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.

  • "[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.

  • "[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.

  • "left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.

  • "bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.

  • "root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side


property Underline

property Item.Underline as Boolean
Specifies whether the item's caption appears as underlined.

Type | Description
Boolean | A Boolean expression that specifies whether the item's caption is underlined.
By default, the Underline property is False. Use the Underline property to show underlined the item's caption. The Caption property indicates the HTML caption to be shown on the item. The <u> HTML tag can be used on the item's Caption property to specify different parts of the caption as underlined.

How can I underline the item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").Underline = True
        .Add "<u>Item</u>"
        .Add("").ToString = "Item[und]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").Underline = True
        .Add "<u>Item</u>"
        .Add("").ToString = "Item[und]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").Underline = True
        .Add("<u>Item</u>")
        .Add("").ToString = "Item[und]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").Underline = True
        .Add("<u>Item</u>")
        .Add("").ToString = "Item[und]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutUnderline(VARIANT_TRUE);
    var_Items->Add(L"<u>Item</u>",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[und]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Underline = true;
    var_Items->Add(L"<u>Item</u>",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[und]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Underline = true;
    var_Items.Add("<u>Item</u>",null,null);
    var_Items.Add("",null,null).ToString = "Item[und]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Underline = true;
        var_Items.Add("<u>Item</u>",null,null);
        var_Items.Add("",null,null).ToString = "Item[und]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Underline = True
            .Add "<u>Item</u>"
            .Add("").ToString = "Item[und]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Underline = true;
    var_Items.Add("<u>Item</u>",null,null);
    var_Items.Add("",null,null).ToString = "Item[und]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Underline(true);
        com_Items.Add("<u>Item</u>");
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[und]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Underline := True;
        Add('<u>Item</u>',Nil,Nil);
        Add('',Nil,Nil).ToString := 'Item[und]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Underline := True;
        Add('<u>Item</u>',Null,Null);
        Add('',Null,Null).ToString := 'Item[und]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").Underline = .T.
        .Add("<u>Item</u>")
        .Add("").ToString = "Item[und]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Underline = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Underline = true]
    endwith
    var_Items.Add("<u>Item</u>")
    // var_Items.Add("").ToString = "Item[und]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[und]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Underline = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Underline = True"

    var_Items.Add("<u>Item</u>")
    ' var_Items.Add("").ToString = "Item[und]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[und]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Underline := true
    var_Items:Add("<u>Item</u>",nil,nil)
    var_Items:Add("",nil,nil):ToString := "Item[und]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Underline = true
    var_Items.Add("<u>Item</u>")
    var_Items.Add("").ToString = "Item[und]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComUnderline of hoItem to True
        Send Destroy to hoItem
        Get ComAdd of hoItems "<u>Item</u>" Nothing Nothing to Nothing
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[und]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):Underline := .T.
            oItems:Add("<u>Item</u>")
            oItems:Add(""):ToString := "Item[und]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


method Update

method Item.Update ()
Updates the item.

Type Description
Use the Update method to update a particular item. The Update method does not re-computes the required size of the item, so it just validates the item's client area. The Update method invalidates the entire control, without resizing the elements inside. The Refresh method refreshes the entire control, including resizing inside elements.


property UserData

property Item.UserData as Variant
Associates an extra data to the object.

Type | Description
Variant | A VARIANT expression that indicates the item's extra data.
By default, the UserData is empty. Use the UserData property to associate any extra data to the item. Use the Caption property to specify the item's caption. Use the Tooltip property to specify the item's tooltip which can be shown when the cursor hovers the item. The Item property searches recursively the item with giving identifier/caption.


property Visible

property Item.Visible as Boolean
Specifies whether the item is visible or hidden.

Type | Description
Boolean | A Boolean expression that specifies whether the item is visible or hidden.
By default, the Visible property is True. You can use the Visible property to show or hide the item. Use the Refresh method to update the control, so the item became hidden. Use the Enabled property to disable an item. A disabled item shows as grayed, and it is un-selectable, so the user can select or highlight it. The Remove method removes an individual Item object giving its identifier or caption.

How can I hide an item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item 1").Visible = False
        .Add "Item 2"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item 1").Visible = False
        .Add "Item 2"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item 1").Visible = False
        .Add("Item 2")
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item 1").Visible = False
        .Add("Item 2")
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item 1",vtMissing,vtMissing)->PutVisible(VARIANT_FALSE);
    var_Items->Add(L"Item 2",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item 1",TNoParam(),TNoParam())->Visible = false;
    var_Items->Add(L"Item 2",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item 1",null,null).Visible = false;
    var_Items.Add("Item 2",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item 1",null,null).Visible = false;
        var_Items.Add("Item 2",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item 1").Visible = False
            .Add "Item 2"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item 1",null,null).Visible = false;
    var_Items.Add("Item 2",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item 1")); com_Item = var_Item;
        com_Item.Visible(false);
        com_Items.Add("Item 2");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Nil,Nil).Visible := False;
        Add('Item 2',Nil,Nil);
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Null,Null).Visible := False;
        Add('Item 2',Null,Null);
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item 1").Visible = .F.
        .Add("Item 2")
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item 1").Visible = false
    var_Item = var_Items.Add("Item 1")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Visible = false]
    endwith
    var_Items.Add("Item 2")
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item 1").Visible = .f.
    var_Item = var_Items.Add("Item 1")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Visible = False"

    var_Items.Add("Item 2")
oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item 1",nil,nil):Visible := false
    var_Items:Add("Item 2",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item 1").Visible = false
    var_Items.Add("Item 2")
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item 1" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComVisible of hoItem to False
        Send Destroy to hoItem
        Get ComAdd of hoItems "Item 2" Nothing Nothing to Nothing
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item 1"):Visible := .F.
            oItems:Add("Item 2")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property X

property Item.X as String
Indicates the x-coordinate of the item relative to the control's view.

Type | Description
String | A String expression that defines the x-coordinate of the item relative to the control's view.
By default, the X property is empty, so the item is arranged by default. The ArrangeItemsAs property specifies the how the items are arranged on the toolbar. The X / Y property indicates the x / y-coordinate of the item relative to the control's view. The X / Y properties have effect for the items on the toolbar only, not on popup/local menus. Call the control's Refresh method, to refresh the item's position.

For instance:

  • "10", indicates that the item is positioned at absolute position.
  • "width - iwidth", aligns the item to the right-side of the control.

This property supports the following keywords ( in pixels ):

  • iwidth, specifies the width of the current item. You can use the iwidthof (unary operator), to get the width of other item giving its identifier.
  • iheight, specifies the height of the current item. You can use the iheightof (unary operator), to get the height of other item giving its identifier.
  • width, specifies the width of the toolbar
  • height, specifies the height of the toolbar
  • ipos, indicates the position of the item within the toolbar
  • iid, specifies the item's identifier ( ID property )
  • iwidthof, (unary operator) returns the width in pixels, of the item with the specified identifier. For instance "iwidthof(10)" returns the width of the item with the identifier 10.
  • iheightof, (unary operator) returns the height in pixels, of the item with the specified identifier. For instance "iheightof(10)" returns the height of the item with the identifier 10.

The property supports predefined constants, operators and functions as listed bellow:

The constants are ( DPI-Aware components ):

  • dpi ( DPI constant ), specifies the current DPI setting. and it indicates the minimum value between dpix and dpiy constants. For instance, if current DPI setting is 100%, the dpi constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpi returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%
  • dpix ( DPIX constant ), specifies the current DPI setting on x-scale. For instance, if current DPI setting is 100%, the dpix constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpix returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%
  • dpiy ( DPIY constant ), specifies the current DPI setting on x-scale. For instance, if current DPI setting is 100%, the dpiy constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpiy returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported binary range operators, all these with the same priority 5, are :

  • MIN ( min operator ), indicates the minimum value, so a MIN b returns the value of a, if it is less than b, else it returns b. For instance, the expression value MIN 10 returns always a value greater than 10.
  • MAX ( max operator ), indicates the maximum value, so a MAX b returns the value of a, if it is greater than b, else it returns b. For instance, the expression value MAX 100 returns always a value less than 100.

The supported binary operators, all these with the same priority 0, are :

  • := (Store operator), stores the result of expression to variable. The syntax for := operator is

    variable := expression

    where variable is a integer between 0 and 9. You can use the =: operator to restore any stored variable ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable

  • =: (Restore operator), restores the giving variable ( previously saved using the store operator ). The syntax for =: operator is

    =: variable

    where variable is a integer between 0 and 9. You can use the := operator to store the value of any expression ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for ? operator is

expression ? true_part : false_part

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the %0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found') returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

expression array (c1,c2,c3,...cn)

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D') is equivalent with month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D').

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

expression in (c1,c2,c3,...cn)

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the value in (11,22,33,44,13) is equivalent with (expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13). The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

expression switch (default,c1,c2,c3,...,cn)

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the %0 switch ('not found',1,4,7,9,11) gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1) indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8) statement indicates the working hours for dates as follows:

  • #4/1/2009#, from hours 06:00 AM to 12:00 PM
  • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
  • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions. Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%1) = 8 specifies the cells ( on the column 1 ) that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string. The str operator converts the expression to a string. For instance, the str(-12.54) returns the string "-12.54".
  • dbl (unary operator) converts the expression to a number. The dbl operator converts the expression to a number. For instance, the dbl("12.54") returns 12.54
  • date (unary operator) converts the expression to a date, based on your regional settings. For instance, the date(``) gets the current date ( no time included ), the date(`now`) gets the current date-time, while the date("01/01/2001") returns #1/1/2001#
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS. For instance, the dateS("01/01/2001 14:00:00") returns #1/1/2001 14:00:00#

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number. For instance, the int(12.54) returns 12
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2. For instance, the round(12.54) returns 13
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument. For instance, the floor(12.54) returns 12
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2. For instance, the abs(-12.54) returns 12.54
  • sin (unary operator) returns the sine of an angle of x radians. For instance, the sin(3.14) returns 0.001593.
  • cos (unary operator) returns the cosine of an angle of x radians. For instance, the cos(3.14) returns -0.999999.
  • asin (unary operator) returns the principal value of the arc sine of x, expressed in radians. For instance, the 2*asin(1) returns the value of PI.
  • acos (unary operator) returns the principal value of the arc cosine of x, expressed in radians. For instance, the 2*acos(0) returns the value of PI
  • sqrt (unary operator) returns the square root of x. For instance, the sqrt(81) returns 9.
  • currency (unary operator) formats the giving number as a currency string, as indicated by the control panel. For instance, currency(value) displays the value using the current format for the currency ie, 1000 gets displayed as $1,000.00, for US format.
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string. For instance, the len("Mihai") returns 5.
  • lower (unary operator) returns a string expression in lowercase letters. For instance, the lower("MIHAI") returns "mihai"
  • upper (unary operator) returns a string expression in uppercase letters. For instance, the upper("mihai") returns "MIHAI"
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names. For instance, the proper("mihai") returns "Mihai"
  • ltrim (unary operator) removes spaces on the left side of a string. For instance, the ltrim(" mihai") returns "mihai"
  • rtrim (unary operator) removes spaces on the right side of a string. For instance, the rtrim("mihai ") returns "mihai"
  • trim (unary operator) removes spaces on both sides of a string. For instance, the trim(" mihai ") returns "mihai"
  • reverse (unary operator) reverses the order of the characters in the string a. For instance, the reverse("Mihai") returns "iahiM"
  • startwith (binary operator) specifies whether a string starts with specified string ( 0 if not found, -1 if found ). For instance "Mihai" startwith "Mi" returns -1
  • endwith (binary operator) specifies whether a string ends with specified string ( 0 if not found, -1 if found ). For instance "Mihai" endwith "ai" returns -1
  • contains (binary operator) specifies whether a string contains another specified string ( 0 if not found, -1 if found ). For instance "Mihai" contains "ha" returns -1
  • left (binary operator) retrieves the left part of the string. For instance "Mihai" left 2 returns "Mi".
  • right (binary operator) retrieves the right part of the string. For instance "Mihai" right 2 returns "ai"
  • a lfind b (binary operator) The a lfind b (binary operator) searches the first occurrence of the string b within string a, and returns -1 if not found, or the position of the result ( zero-index ). For instance "ABCABC" lfind "C" returns 2
  • a rfind b (binary operator) The a rfind b (binary operator) searches the last occurrence of the string b within string a, and returns -1 if not found, or the position of the result ( zero-index ). For instance "ABCABC" rfind "C" returns 5.
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on ). For instance "Mihai" mid 2 returns "ihai"
  • a count b (binary operator) retrieves the number of occurrences of the b in a. For instance "Mihai" count "i" returns 2.
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result. For instance, the "Mihai" replace "i" with "" returns "Mha" string, as it replaces all "i" with nothing.
  • a split b, splits the a using the separator b, and returns an array. For instance, the weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' ' gets the weekday as string. This operator can be used with the array.

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel. For instance, the time(#1/1/2001 13:00#) returns "1:00:00 PM"
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance, the timeF(#1/1/2001 13:00#) returns "13:00:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel. For instance, the shortdate(#1/1/2001 13:00#) returns "1/1/2001"
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance, the shortdateF(#1/1/2001 13:00#) returns "01/01/2001"
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format. For instance, the dateF(#01/01/2001 14:00:00#) returns #01/01/2001 14:00:00#
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel. For instance, the longdate(#1/1/2001 13:00#) returns "Monday, January 01, 2001"
  • year (unary operator) retrieves the year of the date (100,...,9999). For instance, the year(#12/31/1971 13:14:15#) returns 1971
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 ). For instance, the month(#12/31/1971 13:14:15#) returns 12.
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 ). For instance, the day(#12/31/1971 13:14:15#) returns 31
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 ). For instance, the yearday(#12/31/1971 13:14:15#) returns 365
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday ). For instance, the weekday(#12/31/1971 13:14:15#) returns 5.
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 ). For instance, the hour(#12/31/1971 13:14:15#) returns 13
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 ). For instance, the min(#12/31/1971 13:14:15#) returns 14
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 ). For instance, the sec(#12/31/1971 13:14:15#) returns 15

The Exontrol's eXPression component is a syntax-editor that helps you to define, view, edit and evaluate expressions. Using the eXPression component you can easily view or check if the expression you have used is syntactically correct, and you can evaluate what is the result you get giving different values to be tested. The Exontrol's eXPression component can be used as an user-editor, to configure your applications.


property Y

property Item.Y as String
Indicates the y-coordinate of the item relative to the control's view.

Type | Description
String | A String expression that defines the x-coordinate of the item relative to the control's view.
By default, the Y property is empty, so the item is arranged by default. The ArrangeItemsAs property specifies the how the items are arranged on the toolbar. The X / Y property indicates the x / y-coordinate of the item relative to the control's view. The X / Y properties have effect for the items on the toolbar only, not on popup/local menus. Call the control's Refresh method, to refresh the item's position.

For instance:

  • "10", indicates that the item is positioned at absolute position.
  • "height - iheight", aligns the item to the bottom-side of the control.

This property supports the following keywords ( in pixels ):

  • iwidth, specifies the width of the current item. You can use the iwidthof (unary operator), to get the width of other item giving its identifier.
  • iheight, specifies the height of the current item. You can use the iheightof (unary operator), to get the height of other item giving its identifier.
  • width, specifies the width of the toolbar
  • height, specifies the height of the toolbar
  • ipos, indicates the position of the item within the toolbar
  • iid, specifies the item's identifier ( ID property )
  • iwidthof, (unary operator) returns the width in pixels, of the item with the specified identifier. For instance "iwidthof(10)" returns the width of the item with the identifier 10.
  • iheightof, (unary operator) returns the height in pixels, of the item with the specified identifier. For instance "iheightof(10)" returns the height of the item with the identifier 10.

The property supports predefined constants, operators and functions as listed bellow:

The constants are ( DPI-Aware components ):

  • dpi ( DPI constant ), specifies the current DPI setting. and it indicates the minimum value between dpix and dpiy constants. For instance, if current DPI setting is 100%, the dpi constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpi returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%
  • dpix ( DPIX constant ), specifies the current DPI setting on x-scale. For instance, if current DPI setting is 100%, the dpix constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpix returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%
  • dpiy ( DPIY constant ), specifies the current DPI setting on x-scale. For instance, if current DPI setting is 100%, the dpiy constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpiy returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported binary range operators, all these with the same priority 5, are :

  • MIN ( min operator ), indicates the minimum value, so a MIN b returns the value of a, if it is less than b, else it returns b. For instance, the expression value MIN 10 returns always a value greater than 10.
  • MAX ( max operator ), indicates the maximum value, so a MAX b returns the value of a, if it is greater than b, else it returns b. For instance, the expression value MAX 100 returns always a value less than 100.

The supported binary operators, all these with the same priority 0, are :

  • := (Store operator), stores the result of expression to variable. The syntax for := operator is

    variable := expression

    where variable is a integer between 0 and 9. You can use the =: operator to restore any stored variable ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable

  • =: (Restore operator), restores the giving variable ( previously saved using the store operator ). The syntax for =: operator is

    =: variable

    where variable is a integer between 0 and 9. You can use the := operator to store the value of any expression ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for ? operator is

expression ? true_part : false_part

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the %0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found') returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

expression array (c1,c2,c3,...cn)

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D') is equivalent with month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D').

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

expression in (c1,c2,c3,...cn)

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the value in (11,22,33,44,13) is equivalent with (expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13). The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

expression switch (default,c1,c2,c3,...,cn)

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the %0 switch ('not found',1,4,7,9,11) gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1) indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8) statement indicates the working hours for dates as follows:

  • #4/1/2009#, from hours 06:00 AM to 12:00 PM
  • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
  • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions. Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%1) = 8 specifies the cells ( on the column 1 ) that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string. The str operator converts the expression to a string. For instance, the str(-12.54) returns the string "-12.54".
  • dbl (unary operator) converts the expression to a number. The dbl operator converts the expression to a number. For instance, the dbl("12.54") returns 12.54
  • date (unary operator) converts the expression to a date, based on your regional settings. For instance, the date(``) gets the current date ( no time included ), the date(`now`) gets the current date-time, while the date("01/01/2001") returns #1/1/2001#
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS. For instance, the dateS("01/01/2001 14:00:00") returns #1/1/2001 14:00:00#

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number. For instance, the int(12.54) returns 12
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2. For instance, the round(12.54) returns 13
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument. For instance, the floor(12.54) returns 12
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2. For instance, the abs(-12.54) returns 12.54
  • sin (unary operator) returns the sine of an angle of x radians. For instance, the sin(3.14) returns 0.001593.
  • cos (unary operator) returns the cosine of an angle of x radians. For instance, the cos(3.14) returns -0.999999.
  • asin (unary operator) returns the principal value of the arc sine of x, expressed in radians. For instance, the 2*asin(1) returns the value of PI.
  • acos (unary operator) returns the principal value of the arc cosine of x, expressed in radians. For instance, the 2*acos(0) returns the value of PI
  • sqrt (unary operator) returns the square root of x. For instance, the sqrt(81) returns 9.
  • currency (unary operator) formats the giving number as a currency string, as indicated by the control panel. For instance, currency(value) displays the value using the current format for the currency ie, 1000 gets displayed as $1,000.00, for US format.
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string. For instance, the len("Mihai") returns 5.
  • lower (unary operator) returns a string expression in lowercase letters. For instance, the lower("MIHAI") returns "mihai"
  • upper (unary operator) returns a string expression in uppercase letters. For instance, the upper("mihai") returns "MIHAI"
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names. For instance, the proper("mihai") returns "Mihai"
  • ltrim (unary operator) removes spaces on the left side of a string. For instance, the ltrim(" mihai") returns "mihai"
  • rtrim (unary operator) removes spaces on the right side of a string. For instance, the rtrim("mihai ") returns "mihai"
  • trim (unary operator) removes spaces on both sides of a string. For instance, the trim(" mihai ") returns "mihai"
  • reverse (unary operator) reverses the order of the characters in the string a. For instance, the reverse("Mihai") returns "iahiM"
  • startwith (binary operator) specifies whether a string starts with specified string ( 0 if not found, -1 if found ). For instance "Mihai" startwith "Mi" returns -1
  • endwith (binary operator) specifies whether a string ends with specified string ( 0 if not found, -1 if found ). For instance "Mihai" endwith "ai" returns -1
  • contains (binary operator) specifies whether a string contains another specified string ( 0 if not found, -1 if found ). For instance "Mihai" contains "ha" returns -1
  • left (binary operator) retrieves the left part of the string. For instance "Mihai" left 2 returns "Mi".
  • right (binary operator) retrieves the right part of the string. For instance "Mihai" right 2 returns "ai"
  • a lfind b (binary operator) The a lfind b (binary operator) searches the first occurrence of the string b within string a, and returns -1 if not found, or the position of the result ( zero-index ). For instance "ABCABC" lfind "C" returns 2
  • a rfind b (binary operator) The a rfind b (binary operator) searches the last occurrence of the string b within string a, and returns -1 if not found, or the position of the result ( zero-index ). For instance "ABCABC" rfind "C" returns 5.
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on ). For instance "Mihai" mid 2 returns "ihai"
  • a count b (binary operator) retrieves the number of occurrences of the b in a. For instance "Mihai" count "i" returns 2.
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result. For instance, the "Mihai" replace "i" with "" returns "Mha" string, as it replaces all "i" with nothing.
  • a split b, splits the a using the separator b, and returns an array. For instance, the weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' ' gets the weekday as string. This operator can be used with the array.

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel. For instance, the time(#1/1/2001 13:00#) returns "1:00:00 PM"
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance, the timeF(#1/1/2001 13:00#) returns "13:00:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel. For instance, the shortdate(#1/1/2001 13:00#) returns "1/1/2001"
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance, the shortdateF(#1/1/2001 13:00#) returns "01/01/2001"
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format. For instance, the dateF(#01/01/2001 14:00:00#) returns #01/01/2001 14:00:00#
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel. For instance, the longdate(#1/1/2001 13:00#) returns "Monday, January 01, 2001"
  • year (unary operator) retrieves the year of the date (100,...,9999). For instance, the year(#12/31/1971 13:14:15#) returns 1971
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 ). For instance, the month(#12/31/1971 13:14:15#) returns 12.
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 ). For instance, the day(#12/31/1971 13:14:15#) returns 31
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 ). For instance, the yearday(#12/31/1971 13:14:15#) returns 365
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday ). For instance, the weekday(#12/31/1971 13:14:15#) returns 5.
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 ). For instance, the hour(#12/31/1971 13:14:15#) returns 13
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 ). For instance, the min(#12/31/1971 13:14:15#) returns 14
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 ). For instance, the sec(#12/31/1971 13:14:15#) returns 15

The Exontrol's eXPression component is a syntax-editor that helps you to define, view, edit and evaluate expressions. Using the eXPression component you can easily view or check if the expression you have used is syntactically correct, and you can evaluate what is the result you get giving different values to be tested. The Exontrol's eXPression component can be used as an user-editor, to configure your applications.


Items object
The Items collection supports the following properties and methods:

Name | Description
Add | Adds an Item object and returns a reference to the newly created object.
BackColor | Specifies the background color of the items.
BackgroundExt | Indicates additional colors, text, images that can be displayed on the items's background using the EBN string format.
Clear | Removes all objects in a collection.
Count | Returns the number of objects in a collection.
HotBackColor | Specifies the hot background color of the items ( when the cursor hovers the items ).
Item | Returns a specific Item object giving its identifier.
Padding | Specifies the padding (space between the menu border and the item content) to display the items.
PopupAppearance | Retrieves or sets the popup's appearance.
Remove | Removes a specific member from the collection.
SortOrder | Sorts the items in the submenu.
ToString | Loads or saves the Items collection using string representation.
VisibleItemsCount | Specifies the maximum number of visible items at one time.


method Add

method Items.Add (Caption as String, [ItemType as Variant], [ID as Variant])
Adds an Item object and returns a reference to the newly created object.

Type | Description
Caption as String | A String expression that specifies the HTML caption to be displayed on the item.
ItemType as Variant | An ItemTypeEnum expression that specifies the type of the item to be added.
ID as Variant | A Long expression that specifies the identifier of the item to be added.
Return | Description
Item | An Item object being created.
The Add method adds a new item to the Items collection. The ToString property loads or saves the control items from a string, so you can use the ToString method to add items too!. The Remove method removes a specified item. The Item property gets the Item object giving its identifier or caption. The SubMenu property gets a collection of Item objects to be displayed on the sub-menu. This property returns a not-empty value, if the ItemType parameter is SubMenu. The SubControl property gets access to the Control object that holds information about the inside ActiveX or Window hosted by the item. This property returns a not-empty value, if the ItemType parameter is SubControl.

The Caption parameter supports the following HTML tags:

  • <b> ... </b> displays the text in bold
  • <i> ... </i> displays the text in italics
  • <u> ... </u> underlines the text
  • <s> ... </s> Strike-through text
  • <a id;options> ... </a> displays an anchor element that can be clicked. An anchor is a piece of text or some other object (for example an image) which marks the beginning and/or the end of a hypertext link.The <a> element is used to mark that piece of text (or inline image), and to give its hypertextual relationship to other documents. The control fires the AnchorClick(AnchorID, Options) event when the user clicks the anchor element. The FormatAnchor property customizes the visual effect for anchor elements.
  • <font face;size> ... </font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor rrggbb> ... </fgcolor> or <fgcolor=rrggbb> ... </fgcolor> displays text with a specified foreground color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <bgcolor rrggbb> ... </bgcolor> or <bgcolor=rrggbb> ... </bgcolor> displays text with a specified background color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <solidline rrggbb> ... </solidline> or <solidline=rrggbb> ... </solidline> draws a solid-line on the bottom side of the current text-line, of specified RGB color. The <solidline> ... </solidline> draws a black solid-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <dotline rrggbb> ... </dotline> or <dotline=rrggbb> ... </dotline> draws a dot-line on the bottom side of the current text-line, of specified RGB color. The <dotline> ... </dotline> draws a black dot-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <upline> ... </upline> draws the line on the top side of the current text-line (requires <solidline> or <dotline>).
  • <r> right aligns the text
  • <c> centers the text
  • <br> forces a line-break
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number; ( the character with specified code ), For instance, the &#8364; displays the EUR character. The & ampersand is only recognized as markup when it is followed by a known letter or a #character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;
  • <off offset> ... </off> defines the vertical offset to display the text/element. The offset parameter defines the offset to display the element. This tag is inheritable, so the offset is keep while the associated </off> tag is found. You can use the <off offset> HTML tag in combination with the <font face;size> to define a smaller or a larger font to be displayed. For instance: Text with <font ;7><off 6>subscript displays the text such as: Text with subscript The Text with <font ;7><off -6>superscript displays the text such as: Text with subscript
  • <gra rrggbb;mode;blend> ... </gra> defines a gradient text. The text color or <fgcolor> defines the starting gradient color, while the rr/gg/bb represents the red/green/blue values of the ending color, 808080 if missing as gray. The mode is a value between 0 and 4, 1 if missing, and blend could be 0 or 1, 0 if missing. The <font> HTML tag can be used to define the height of the font. Any of the rrggbb, mode or blend field may not be specified. The <gra> with no fields, shows a vertical gradient color from the current text color to gray (808080). For instance the <font ;18><gra FFFFFF;1;1>gradient-center</gra></font> generates the following picture:
  • <out rrggbb;width> ... </out> shows the text with outlined characters, where rr/gg/bb represents the red/green/blue values of the outline color, 808080 if missing as gray, width indicates the size of the outline, 1 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><out 000000><fgcolor=FFFFFF>outlined</fgcolor></out></font> generates the following picture:
  • <sha rrggbb;width;offset> ... </sha> define a text with a shadow, where rr/gg/bb represents the red/green/blue values of the shadow color, 808080 if missing as gray, width indicates the size of shadow, 4 if missing, and offset indicates the offset from the origin to display the text's shadow, 2 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><sha>shadow</sha></font> generates the following picture:

    or <font ;31><sha 404040;5;0><fgcolor=FFFFFF>outline anti-aliasing</fgcolor></sha></font> gets:


property BackColor

property Items.BackColor as Color
Specifies the background color of the items.

Type | Description
Color | A Color expression that specifies the items' background color. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The BackColor property specifies the solid color / visual appearance to be shown on the items' background ( inside borders ). The BackgroundExt property indicates additional colors, text, images that can be displayed on the items's background using the EBN string format. The PopupAppearance property specifies the visual appearance of the items ( including the margins/borders ). The HotBackColor property specifies the background color for items when cursor hovers it. The Padding property specifies the padding (space between the menu border and the item content) to display the items.

The following screen shot shows different grouping items (Clipboard, Font, Adjust) with different background appearance.

How can I change the visual appearance for items (EBN)?

VBA (MS Access, Excell...)

With ToolBar1
    .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                .BackColor = &H1000000
                .Padding = "4,8,4,8"
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh
End With

VB6

With ToolBar1
    .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                .BackColor = &H1000000
                .Padding = "4,8,4,8"
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                .BackColor32 = &H1000000
                .Padding = "4,8,4,8"
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                .BackColor = &H1000000
                .Padding = "4,8,4,8"
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutBackColor(0x1000000);
            var_Items1->PutPadding(L"4,8,4,8");
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)");
spToolBar1->Refresh();

C++ Builder

ToolBar1->VisualAppearance->Add(1,TVariant("c:\\exontrol\\images\\normal.ebn"));
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->BackColor = 0x1000000;
            var_Items1->Padding = L"4,8,4,8";
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)";
ToolBar1->Refresh();

C#

extoolbar1.VisualAppearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.BackColor32 = 0x1000000;
            var_Items1.Padding = "4,8,4,8";
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
    var_Items.Add("",null,null).ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.VisualAppearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var_Items1.BackColor = 16777216;
                var_Items1.Padding = "4,8,4,8";
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
        var_Items.Add("",null,null).ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    .BackColor = &H1000000
                    .Padding = "4,8,4,8"
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
            End With
            .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.VisualAppearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.BackColor = 0x1000000;
            var_Items1.Padding = "4,8,4,8";
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
    var_Items.Add("",null,null).ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Items,var_Items1;
    ;

    super();

    extoolbar1.VisualAppearance().Add(1,"c:\\exontrol\\images\\normal.ebn");
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.BackColor(0x1000000);
                com_Items1.Padding("4,8,4,8");
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
        var_Item1 = COM::createFromObject(com_Items.Add("")); com_Item1 = var_Item1;
        com_Item1.ToString("[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                BackColor := $1000000;
                Padding := '4,8,4,8';
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
        end;
        Add('',Nil,Nil).ToString := '[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                BackColor := $1000000;
                Padding := '4,8,4,8';
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
        end;
        Add('',Null,Null).ToString := '[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                .BackColor = 0x1000000
                .Padding = "4,8,4,8"
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
        endwith
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
oToolBar.VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Items1.BackColor = 0x1000000
            var_Items1.Padding = "4,8,4,8"
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    // var_Items.Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Items1.BackColor = 16777216
            var_Items1.Padding = "4,8,4,8"
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    ' var_Items.Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)\""

oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

oDCOCX_Exontrol1:VisualAppearance:Add(1,"c:\exontrol\images\normal.ebn")
var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Items1:BackColor := 0x1000000
            var_Items1:Padding := "4,8,4,8"
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
    var_Items:Add("",nil,nil):ToString := "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
oToolBar.VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Items1.BackColor = 16777216 /*0x1000000*/
            var_Items1.Padding = "4,8,4,8"
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    var_Items.Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voAppearance
    Get ComVisualAppearance to voAppearance
    Handle hoAppearance
    Get Create (RefClass(cComAppearance)) to hoAppearance
    Set pvComObject of hoAppearance to voAppearance
        Get ComAdd of hoAppearance 1 "c:\exontrol\images\normal.ebn" to Nothing
    Send Destroy to hoAppearance
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComBackColor of hoItems1 to |CI$1000000
                Set ComPadding of hoItems1 to "4,8,4,8"
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItems1:SetProperty("BackColor",0x1000000)
                    oItems1:Padding := "4,8,4,8"
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
            oItems:Add(""):ToString := "[group=0x03][itemspad=4,8,4,8][itemsbg=0x1000000](Item 1,Item 2,Item 3)"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property BackgroundExt

property Items.BackgroundExt as String
Indicates additional colors, text, images that can be displayed on the items's background using the EBN string format.

Type | Description
String | A String expression ( "EBN String Format" ) that defines the layout of the UI to be applied on the items' background. The syntax of EBN String Format in BNF notation is shown bellow. You can use the EBN's Builder of eXButton/COM control to define visually the EBN String Format.
By default, the BackgroundExt property is empty. Using the BackgroundExt property you have unlimited options to show any HTML text, images, colors, EBNs, patterns, frames anywhere on the items' background. For instance, let's say you need to display more colors on the items' background, or just want to display an additional caption or image to a specified location on the items' background. The EBN String Format defines the parts of the EBN to be applied on the items' background. The EBN is a set of UI elements that are built as a tree where each element is anchored to its parent element. The BackgroundExt property is applied right after setting the object's backcolor, and before drawing the default object's captions, icons or pictures. The BackgroundExt property is shown on the item's background, while the ForegroundExt property is shown on the item's foreground.

In the following screen shot the Views, Clipboard, Font and Speakers are shown using the BackgroundExt property:

as "bottom[2],bottom[16,text=`</fgcolor><fgcolor 6D6AAA>Views</fgcolor><fgcolor A0A0A0>`,align=0x21]", shows the Views aligned to the bottom, with a different foreground color.

Easy samples:

  • "[pattern=6]", shows the BDiagonal pattern on the object's background.

  • "[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.

  • "[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.

  • "[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:

  • "top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.

  • "[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.

  • "[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.

  • "left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.

  • "bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.

  • "root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side

The Exontrol's eXButton WYSWYG Builder helps you to generate or view the EBN String Format, in the To String field as shown in the following screen shot:

The To String field of the EBN Builder defines the EBN String Format that can be used on BodyBackgroundExt property.

The EBN String Format syntax in BNF notation is defined like follows:

<EBN> ::= <elements> | <root> "(" [<elements>] ")"
<elements> ::= <element> [ "," <elements> ]
<root> ::= "root" [ <attributes> ] | [ <attributes> ]
<element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ]
<anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom"
<attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]"
<client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression>
<expression> ::= <number> | <number> "%"
<attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others>
<equal> ::= "="
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<decimal> ::= <digit><decimal>
<hexadigit> ::= <digit> | "A" | "B"  "C" | "D" | "E"  "F"
<hexa> ::= <hexadigit><hexa>
<number> ::= <decimal> | "0x" <hexa>
<color> ::= <rgbcolor> | number
<rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")"
<string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> "
<characters> ::= <char>|<characters>
<char> ::= <any_character_excepts_null>
<backcolor> ::= "back" <equal> <color>
<text> ::= "text" <equal> <string>
<align> ::= "align" <equal> <number>
<pattern> ::= "pattern" <equal> <number>
<patterncolor> ::= "patterncolor" <equal> <color>
<frame> ::= "frame" <equal> <color>
<data> ::= "data" <equal> <number> | <string>
<framethick> ::= "framethick"
<wordwrap> ::= "wordwrap"

Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.


method Clear

method Items.Clear ()
Removes all objects in a collection.

Type Description
Use the Clear method to clear all elements/items in the collection. The Remove method removes an item giving its identifier.


property Count

property Items.Count as Long
Returns the number of objects in a collection.

Type | Description
Long | A Long expression that specifies the number of Item objects in the collection.
The Count property specifies the the number of Item objects in the collection. The Add method adds a new item to the Items collection, while the Remove method removes an item giving its identifier. Use the Clear method to clear all elements/items in the collection.


property HotBackColor

property Items.HotBackColor as Color
Specifies the hot background color of the items ( when the cursor hovers the items ).

Type | Description
Color | A Color expression that specifies the items' background color, when the cursor hovers it. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The HotBackColor property specifies the background color for items when cursor hovers it. The BackColor property specifies the solid color / visual appearance to be shown on the items' background ( inside borders ). The BackgroundExt property indicates additional colors, text, images that can be displayed on the items's background using the EBN string format. The PopupAppearance property specifies the visual appearance of the items ( including the margins/borders ). The Padding property specifies the padding (space between the menu border and the item content) to display the items.

How can I change the visual appearance for items, when cursor hovers it (hot,EBN)?

VBA (MS Access, Excell...)

With ToolBar1
    .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                .HotBackColor = &H1000000
                .Padding = "4,8,4,8"
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh
End With

VB6

With ToolBar1
    .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                .HotBackColor = &H1000000
                .Padding = "4,8,4,8"
                .Add "Item 1"
                .Add "Item 2"
                .Add "Item 3"
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                .HotBackColor32 = &H1000000
                .Padding = "4,8,4,8"
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                .HotBackColor = &H1000000
                .Padding = "4,8,4,8"
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            End With
        End With
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutHotBackColor(0x1000000);
            var_Items1->PutPadding(L"4,8,4,8");
            var_Items1->Add(L"Item 1",vtMissing,vtMissing);
            var_Items1->Add(L"Item 2",vtMissing,vtMissing);
            var_Items1->Add(L"Item 3",vtMissing,vtMissing);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)");
spToolBar1->Refresh();

C++ Builder

ToolBar1->VisualAppearance->Add(1,TVariant("c:\\exontrol\\images\\normal.ebn"));
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->HotBackColor = 0x1000000;
            var_Items1->Padding = L"4,8,4,8";
            var_Items1->Add(L"Item 1",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 2",TNoParam(),TNoParam());
            var_Items1->Add(L"Item 3",TNoParam(),TNoParam());
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)";
ToolBar1->Refresh();

C#

extoolbar1.VisualAppearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.HotBackColor32 = 0x1000000;
            var_Items1.Padding = "4,8,4,8";
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
    var_Items.Add("",null,null).ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.VisualAppearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var_Items1.HotBackColor = 16777216;
                var_Items1.Padding = "4,8,4,8";
                var_Items1.Add("Item 1",null,null);
                var_Items1.Add("Item 2",null,null);
                var_Items1.Add("Item 3",null,null);
        var_Items.Add("",null,null).ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .VisualAppearance.Add 1,"c:\exontrol\images\normal.ebn"
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    .HotBackColor = &H1000000
                    .Padding = "4,8,4,8"
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                End With
            End With
            .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.VisualAppearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.HotBackColor = 0x1000000;
            var_Items1.Padding = "4,8,4,8";
            var_Items1.Add("Item 1",null,null);
            var_Items1.Add("Item 2",null,null);
            var_Items1.Add("Item 3",null,null);
    var_Items.Add("",null,null).ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Items,var_Items1;
    ;

    super();

    extoolbar1.VisualAppearance().Add(1,"c:\\exontrol\\images\\normal.ebn");
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.HotBackColor(0x1000000);
                com_Items1.Padding("4,8,4,8");
                com_Items1.Add("Item 1");
                com_Items1.Add("Item 2");
                com_Items1.Add("Item 3");
        var_Item1 = COM::createFromObject(com_Items.Add("")); com_Item1 = var_Item1;
        com_Item1.ToString("[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                HotBackColor := $1000000;
                Padding := '4,8,4,8';
                Add('Item 1',Nil,Nil);
                Add('Item 2',Nil,Nil);
                Add('Item 3',Nil,Nil);
            end;
        end;
        Add('',Nil,Nil).ToString := '[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                HotBackColor := $1000000;
                Padding := '4,8,4,8';
                Add('Item 1',Null,Null);
                Add('Item 2',Null,Null);
                Add('Item 3',Null,Null);
            end;
        end;
        Add('',Null,Null).ToString := '[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                .HotBackColor = 0x1000000
                .Padding = "4,8,4,8"
                .Add("Item 1")
                .Add("Item 2")
                .Add("Item 3")
            endwith
        endwith
        .Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
oToolBar.VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Items1.HotBackColor = 0x1000000
            var_Items1.Padding = "4,8,4,8"
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    // var_Items.Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Items1.HotBackColor = 16777216
            var_Items1.Padding = "4,8,4,8"
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    ' var_Items.Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)\""

oToolBar.Refresh()

Visual Objects

local var_Item as IItem
local var_Items,var_Items1 as IItems

oDCOCX_Exontrol1:VisualAppearance:Add(1,"c:\exontrol\images\normal.ebn")
var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Items1:HotBackColor := 0x1000000
            var_Items1:Padding := "4,8,4,8"
            var_Items1:Add("Item 1",nil,nil)
            var_Items1:Add("Item 2",nil,nil)
            var_Items1:Add("Item 3",nil,nil)
    var_Items:Add("",nil,nil):ToString := "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Items,var_Items1

oToolBar = ole_1.Object
oToolBar.VisualAppearance.Add(1,"c:\exontrol\images\normal.ebn")
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Items1.HotBackColor = 16777216 /*0x1000000*/
            var_Items1.Padding = "4,8,4,8"
            var_Items1.Add("Item 1")
            var_Items1.Add("Item 2")
            var_Items1.Add("Item 3")
    var_Items.Add("").ToString = "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voAppearance
    Get ComVisualAppearance to voAppearance
    Handle hoAppearance
    Get Create (RefClass(cComAppearance)) to hoAppearance
    Set pvComObject of hoAppearance to voAppearance
        Get ComAdd of hoAppearance 1 "c:\exontrol\images\normal.ebn" to Nothing
    Send Destroy to hoAppearance
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComHotBackColor of hoItems1 to |CI$1000000
                Set ComPadding of hoItems1 to "4,8,4,8"
                Get ComAdd of hoItems1 "Item 1" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 2" Nothing Nothing to Nothing
                Get ComAdd of hoItems1 "Item 3" Nothing Nothing to Nothing
            Send Destroy to hoItems1
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItems1:SetProperty("HotBackColor",0x1000000)
                    oItems1:Padding := "4,8,4,8"
                    oItems1:Add("Item 1")
                    oItems1:Add("Item 2")
                    oItems1:Add("Item 3")
            oItems:Add(""):ToString := "[group=0x03][itemspad=4,8,4,8][itemsbghot=0x1000000](Item 1,Item 2,Item 3)"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Item

property Items.Item (ID as Variant) as Item
Returns a specific Item object giving its identifier.

Type | Description
ID as Variant | A Long expression that specifies the identifier of the item being requested or a String expression that specifies the caption of the item being requested.
Item | An Item object with associated identifier.
The Item property looks in the Items collection for the item with the specified identifier or caption. You can use the Item property of the toolbar control to recursively search for an item giving its identifier or caption. The ID property of the Item object specifies the identifier of the item. The Caption property of the Item object specifies the caption of the item. The Item property gets the first Item object being found, if multiple objects with the same identifier are found, or Nothing, if no item with associated identifier is found.


property Padding

property Items.Padding as String
Specifies the padding (space between the menu border and the item content) to display the items.

Type | Description
String | A string expression that indicates a list of 4 positive numbers separated by comma characters, which indicates the distance in pixels from margin to client, in the following format: left, top, right, bottom.
By default, the Padding property is empty ( 0,0,0,0 ). The Padding property specifies the padding (space between the menu border and the item content) to display the items. The BackgroundExt property indicates additional colors, text, images that can be displayed on the items's background using the EBN string format. When using EBN appearance, using the PopupAppearance, LocalAppearance or Appearance, the distance between margins/borders and items client area is indicated by the client object of the skin/ebn object. The Padding property specifies the padding for a particular item.

The following screen shot shows the control with no padding:

The following screen shot shows the control with padding 16, 16, 16, 16:


property PopupAppearance

property Items.PopupAppearance as ToolBarAppearanceEnum
Retrieves or sets the popup's appearance.

Type | Description
ToolBarAppearanceEnum | A ToolBarAppearanceEnum expression that indicates the popup's appearance.
By default, the PopupAppearance property is specified by the control's Appearance property. The PopupAppearance specifies a different visual appearance for the current submenu. The SubMenu property determines the items to be displayed on the popup item. The BackColor property specifies the solid color / visual appearance to be shown on the items' background ( inside borders ). The BackgroundExt property indicates additional colors, text, images that can be displayed on the items's background using the EBN string format. When using EBN appearance, using the PopupAppearance, LocalAppearance or Appearance, the distance between margins/borders and items client area is indicated by the client object of the skin/ebn object.

The appearance of the popup is determined by the following:

  • PopupAppearance, specifies the visual appearance of the current sub-menu.
  • LocalAppearance, determines the visual appearance of the popup, if it is local ( ShowLocalPopup property )
  • Appearance, specifies the general visual appearance of the popup items.

The following screen shot shows the sub-menu with different appearances:

(single appearance)

(shadow appearance)

(ebn appearance)

(ebn appearance)


method Remove

method Items.Remove (ID as Variant)
Removes a specific member from the collection.

Type | Description
ID as Variant | A Long expression that specifies the item to be removed. A String expression that specifies the caption of the Item to be removed
The Remove method removes an individual Item object giving its identifier or caption. The Visible property specifies whether the item is visible or hidden.


property SortOrder

property Items.SortOrder as SubMenuSortOrderEnum
Sorts the items in the submenu.

Type | Description
SubMenuSortOrderEnum | A SubMenuSortOrderEnum expression that specifies the way the submenu displays its items.
By default, the SortOrder property is exSubMenuUnsorted, which indicates that the items are displayed on the submenu as they were added. Use the SortOrder property to sort the items to be displayed on the sub menu.


property ToString

property Items.ToString as String
Loads or saves the Items collection using string representation.

Type | Description
String | A String expression that specifies the items to be added. The list of items is separated by , (comma) character, while sub-menus are include between () parenthesis. The [] brackets indicates the options to be applied on the item

The ToString property loads or saves the control items from a string. The Add method adds a new item to the Items collection. The Remove method removes a specified item.

For instance, the "Item 1,Item 2,[sep],Check 1[chk],Check 2[chk]", generates the following screen shot:

For instance, the "Item 1,Item 2,Popup(Check 1[chk],Check 2[chk])", generates the following screen shot:

For instance, the "Calendar[id=20][img=0],MSChart[id=30],Record[id=40],Slider[id=50],Radio 1[id=100][typ=2][edit=],Radio 2[id=101][typ=2][edit=],Radio 3[id=102][typ=2][edit=],ComboBox[id=90]", generates the following screen shot:

The ToString syntax in BNF notation:

<ToString> ::= <ITEMS>
<ITEMS> ::= <ITEM>["("<ITEMS>")"][","<ITEMS>]
<ITEM> ::= <CAPTION>[<OPTIONS>]
<OPTIONS> ::= "["<OPTION>"]"["["<OPTIONS>"]"]
<OPTION> ::= <PROPERTY>["="<VALUE>]
<PROPERTY> ::= "img" | "himg" | "sep" | "id" | "typ" | "group" | "chk" | "button" | "align" | "spchk" | "show" | "rad" | "dis" | "showdis" | "bld" | "itl" | "stk" | "und" | "bg" | "fg" | "edittype" | "edit" | "mask" | "border" | "editwidth" | "captionwidth" | "height" | "grp" | "tfi" | "ttp" | "min" | "max" | "tick" | "freq" | "ticklabel" | "small" | "large" | "spin" | "ettp" | "float" | "close" | "local" | "popupapp" | "itemspad" | "itemsbg" | "itemsbghot" | "itemsbgext" | "visible" | "tab" | "pad" | "bghot" | "bgsel" | "bgselhot" | "arrow" | "popupalign" | "popupoffset" | "popupat"| "hid"

where the <CAPTION> is the HTML caption to be shown on the context menu item. The <VALUE> indicates the value of giving property.

  • id=<VALUE>, where <VALUE> is an integer expression, that indicates the identifier of the item.
  • bg=<VALUE>, specifies the item's background color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bghot=<VALUE>, specifies the item's background color, while the cursor hovers the item, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bgsel=<VALUE>, specifies the item's background color, while the item is checked/selected, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bgselhot=<VALUE>, specifies the item's background color, while the item is checked/selected and the cursor hovers it, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • fg=<VALUE>, specifies the item's foreground color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or a integer expression.
  • sep, specifies an separator item
  • dis, specifies a disabled item
  • hid, specifies a hidden item
  • showdis=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the item shows as disabled, but it is still enabled
  • bld, specifies that the item appears in bold
  • itl, specifies that the item appears in italics
  • stk, specifies that the item appears as strikeout
  • und, specifies that the item is underlined
  • align=<VALUE>, where <VALUE> could be one of the following:
    • 0 ( left ), to align the item's caption to the left
    • 1 ( center ), to center the item's caption
    • 2 ( right ), to align the item's caption to the right
  • captionwidth=<VALUE>, specifies the width to show the HTML caption of the item. where <VALUE> could be a integer expression. A negative value indicates that no limitation is applied to the item's caption, so no truncate caption is shown
  • height=<VALUE>, specifies the height to show the item, where <VALUE> could be a positive integer expression
  • pad=<VALUE>, specifies the padding (space between the menu border and the item content) to display the item. The <VALUE> is a list of coordinates such as left,top,right,bottom
  • img=<VALUE>, where <VALUE> is an integer expression, that indicates the index of the icon being displayed for the item.
  • himg=<VALUE>, where <VALUE> indicates the key of the picture to be displayed for the item.

  • typ=<VALUE>, where <VALUE> could be one of the following:
    • 0 for default/regular items ( no check/radio button is associated with the item ),
    • 1 for items that display a check/box (chk),
    • 2 to display radio buttons (rad)
  • chk[=<VALUE>], where <VALUE> could be 0 for unchecked, or not zero for checked. The chk option makes the item to display a check box. If the <VALUE> is missing the item still displays an un-checked check box.
  • rad=<VALUE>, where <VALUE> could be 0 for unchecked radio button or not zero to for checked radio button. Use the grp option to define the group of radio where this button should be associated, If no group of radio buttons is required, the grp could be ignored.
  • grp=<VALUE>, defines the radio group. It should be used when you define more groups of radio buttons. A group of radio buttons means that only one item could be checked at one time. The rad option specifies that the item displays a radio button. Use the grp option to define the group of radio where this button should be associated, If no group of radio buttons is required, the grp could be ignored. The <VALUE> could be any integer expression.

  • show=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the checked item shows as selected
  • spchk=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the item's sub menu is shown only if the item is checked.

  • group=<VALUE>, where <VALUE> could be a bit-or combination (+) of the following values:
    • 0 (exNoGroupPopup), No grouping is performed on the sub-menu, so the sub-items are shown to a float popup,
    • 1 (exGroupPopup), Groups and displays the sub-menu items on the current item, arranged from left to right/horizontally
    • 2 (exNoGroupPopupFrame), Prevents showing the frame around each grouping item.
    • 4 (exGroupPopupCenter), Shows the grouping popup aligned to the center of the current item.
    • 8 (exGroupPopupRight), Shows the grouping popup aligned to the right of the current item.
    • 16 (exGroupPopupEqualWidth), Shows the items that make the group of the same width
    • 32 (exGroupPopupEqualHeight), Shows the items that make the group of the same height
    • 64 (exGroupPopupFrameSolidBox), Shows a solid frame around the grouped items
    • 128 (exGroupPopupFrameThickBox), Shows a solid thick-frame around the grouped items
    • 256 (exGroupPopupVertical), Groups and displays the sub-menu items on the current item, arranged from top to bottom/vertically

  • button=<VALUE>, where <VALUE> could be a bit-or combination (+) of the following values.
    • 0 (exShowAsButtonNone), No button is shown,
    • 1 (exShowAsButton), Shows the item as a button
    • 2 (exShowAsButtonAutoSize), Fits the button to cover the item's caption instead showing on the entire item
    • 17 (exShowAsSelectButton), Shows the item as a select button, which is composed by two-fields, one indicates the default button, while the second field specifies the drop down button that displays the items in the current's sub-menu collection. The drop down button is shown to the right-side of the default button. The item must have a submenu, else no drop down is displayed.
    • 273 (exShowAsSelectButtonBottom), Shows the item as a select button, which is composed by two-fields, one indicates the default button, while the second field specifies the drop down button that displays the items in the current's sub-menu collection. The drop down button is shown to the bottom-side of the default button. The item must have a submenu, else no drop down is displayed.

  • ttp=<VALUE>, defines the item's tooltip. The <VALUE> could be any HTML string expression. The item's tooltip is shown when the user hovers the item.

  • edittype=<VALUE>, associates an edit field to the item, where <VALUE> could be a combination of one or more of the following values:
    • 0 ( exItemDisableEdit ), No editor is assigned to the current item.
    • 1 ( exItemEditText ), A text-box editor is assigned to the current item.
    • 2 ( exItemEditMask ), A masked text-box editor is assigned to the current item.
    • 3 ( exItemEditSlider ), A slider editor is assigned to the current item. This can be combined with 1024.
    • 4 ( exItemEditProgress ), A progress editor is assigned to the current item. This can be combined with 1024.
    • 5 ( exItemEditScrollBar ), A scrollbar editor is assigned to the current item. This can be combined with 1024.
    • 6 ( exItemEditColor), A color editor is assigned to the current item.
    • 7 ( exItemEditFont ), A font editor is assigned to the current item.
    • 256 (exItemEditReadOnly), specifies that the item's editor is shown as disabled. This value could be combined with one of the values from 0 to 7 or 512
    • 512 ( exItemEditSpin ), A spin editor is assigned to the current item. This value could be combined with one of the values from 0 to 7 or 256
    • 1024 ( exItemEditVertical ), The editor is shown vertically rather than horizontally. This value has effect for exItemEditSlider, exItemEditProgress or exItemEditScrollBar
  • edit=<VALUE>, specifies the caption to be shown in the item's edit field, where <VALUE> could be any string
  • mask=<VALUE>, specifies the mask to be applied on a masked editor. This option is valid for exItemEditMask edit. Use the float option to allow masking floating point numbers. See Masking for more information about <VALUE> of the mask option. See Masking Float for more information about <VALUE> if the float option is used.
  • float=<VALUE>, Specifies whether the mask field masks a floating point number. This option is valid for exItemEditMask edit. See Masking Float for more information about <VALUE> of mask option, if the float option is used. The <VALUE> could be 0 for standard masking field or not zero to specify that the field is masking a floating point.
  • border=<VALUE>, specifies the border to be shown on the item's edit field, where <VALUE> could be one of the following:
    • 0 ( exEditBorderNone), No border is shown.
    • -1 (exEditBorderInset), shows an inset border
    • 1 (exEditBorderSingle), shows a frame border
  • editwidth=<VALUE>, specifies the width to show the edit field inside the item, where <VALUE> could be a integer expression. A negative value indicates that the field goes to the end of the item
  • min=<VALUE>, defines the minimum value of the edit field. The <VALUE> could be any integer expression, and specifies the minimum value for any slider, progress, scroll, spin, or range editor.
  • max=<VALUE>, defines the maximum value of the edit field. The <VALUE> could be any integer expression, and specifies the maximum value for any slider, progress, scroll, spin, or range editor.
  • tick=<VALUE>, defines where the ticks of the slider edit appear. This option is valid for exItemEditSlider edit. The <VALUE> could be one of the following values:
    • 0 ( exBottomRight ), The ticks are displayed on the bottom/right side.
    • 1 ( exTopLeft ), The ticks are displayed on the top/left side.
    • 2 ( exBoth ), The ticks are displayed on the both side.
    • 3 ( exNoTicks ), No ticks are displayed.
  • freq=<VALUE>, indicates the ratio of ticks on the slider edit. This option is valid for exItemEditSlider edit. The <VALUE> could be a positive integer expression.
  • ticklabel=<VALUE>, indicates the HTML label to be displayed on slider's ticks. This option is valid for exItemEditSlider edit. See Tick Label Expression for more information about <VALUE> of the ticklabel option.
  • small=<VALUE>, indicates the amount by which the edit's position changes when the user presses the arrow key ( left, right, or button ). This option is valid for exItemEditSlider, exItemEditScrollBar edit. The <VALUE> could be a positive integer expression.
  • large=<VALUE>, indicates the amount by which the edit's position changes when the user presses the CTRL + arrow key ( CTRL + left, CTRL + right). This option is valid for exItemEditSlider, exItemEditScrollBar edit. The <VALUE> could be a positive integer expression.
  • spin=<VALUE>, specifies the step to advance when user clicks the editor's spin.. This option is valid for exItemEditSpin edit. The <VALUE> could be a positive integer expression.
  • ettp=<VALUE>, specifies the HTML tooltip to be shown when the item's value is changed. This option is valid for exItemEditSlider/exItemEditScrollBar edit. The <VALUE> could be any string expression, including built-in HTML tags
  • arrow=<VALUE>. The <VALUE> could be 0 for hiding the arrow or not zero to show the arrow. Indicates whether an item that has a sub-menu shows or hides its popup arrow. If the <VALUE> is missing, the item shows no arrow.
  • local=<VALUE>. The <VALUE> could be 0 for standard popup or not zero to specify that the field is a local popup. Specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.
  • close=<VALUE>, Specifies the way the hosting menu is closed when the user clicks the item. If the close flag is missing, the <VALUE> is 3 (exCloseOnNonClickable), by default. The <VALUE> could be one of the following values:
    • 0 ( exCloseOnClick ), The popup menu is closing when the user clicks the item.
    • 1 ( exCloseOnDblClick ), The popup menu is closing when the user double clicks the item.
    • 2 ( exCloseOnClickOutside ), The popup menu is closing when the user clicks outside of the menu.
    • 3 ( exCloseOnNonClickable ), The popup menu is closing when the user clicks a non-clickable item ( regular items ). The non-clickable items is any item that's not a separator, popup, disabled or check or radio items, clicking a check-box item will makes the check box to change its state instead closing the context menu.
  • popupapp=<VALUE> indicates the visual appearance of the item's submenu when the popup is shown. The <VALUE> could be a predefine value like shown bellow, or an integer expression that refers an EBN object.
    • 0 ( NoBorder )
    • 1 ( FlatBorder )
    • 2 ( SunkenBorder )
    • 3 ( RaisedBorder )
    • 4 ( EtchedBorder )
    • 5 ( BumpBorder )
    • 6 ( ShadowBorder )
    • 7 ( InsetBorder )
    • 8 ( SingleBorder )
  • itemsbg=<VALUE>, specifies the items background color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • itemsbghot=<VALUE>, specifies the items background color, while the cursor hovers the items, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • popupalign=<VALUE>, Indicates how the item's sub-menu is aligned relative to the parent item. The popupalign has no effect for an item that displays a select- button. The <VALUE> could be a combination of one or more of the following values:
    • 0 ( exShowPopupAlignNone ), The popup menu is shown on top of the item, aligned to the left ( no down and right, so up and left )
    • 1 ( exShowPopupAlignDown ), The popup menu is shown down. If missing, the popup menu is shown up.
    • 2 ( exShowPopupAlignRight ), The popup menu is shown aligned to the right, else if missing, the popup menu is shown aligned to the left.
  • popupat=<VALUE>, specifies the identifier of the item where the current item's submenu/popup is displayed. The <VALUE> could be any integer expression. If there is no identifier with giving value, the option has no effect.
  • popupoffset=<VALUE>, specifies the offset (horizontal,vertical) to display the item's submenu/popup relative to its default position.
  • itemspad=<VALUE>, specifies the padding (space between the menu border and the item content) to display the items. The <VALUE> is a list of coordinates such as left,top,right,bottom
  • visible=<VALUE>, specifies the maximum number of visible items at one time, where the <VALUE> could be any integer expression.
  • tab=<VALUE>, specifies the identifier of the item/tab where the current group-popup is shown instead. The <VALUE> could be any integer expression. If there is no identifier with giving value, the option has no effect.
  • itemsbgext=<VALUE>, indicates additional colors, text, images that can be displayed on the items background using the EBN String Format. The <VALUE> should be in EBN String Format. For instance, [itemsbgext=bottom[2],bottom[16,text=`</fgcolor><fgcolor 6D6AAA>Views</fgcolor><fgcolor A0A0A0>`,align=0x21]], shows the Views aligned to the bottom, with a different foreground color.

Masking, (mask option)

For instance, the following input-mask ( ext-phone )

!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid character,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."

indicates the following:

  • The pattern should contain 3 optional digits 999, and 7 required digits 000 0000, aligned to the right, !.
  • The second part of the input mask indicates 1, which means that all literals are included when the user leaves the field.
  • The entire field is selected when it receives the focus, select=1
  • The field supports empty value, so the user can leave the field with no content
  • The field enters in overtype mode, and insert-type mode is not allowed when user pressed the Insert key
  • If the user enters any invalid character, a warning tooltip with the message "invalid character" is displayed.
  • If the user tries to leave the field, while the field is not validated ( all 7 required digits completed ), the invalid tooltip is shown with the message "The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." The <%mask%> is replaced with the first part of the input mask !(999) 000 0000

The four parts of an input mask, or the Mask property supports up to four parts, separated by a semicolon (;). For instance, "`Time: `00:00:00;;0;overtype,warning=<fgcolor FF0000>invalid character,beep", indicates the pattern "00:00" with the prefix Time:, the masking character being the 0, instead _, the field enters in over-type mode, insert-type mode is not allowed, and the field beeps and displays a tooltip in red with the message invalid character when the user enters an invalid character.

Input masks are made up one mandatory part and three optional parts, and each part is separated by a semicolon (;). If a part should use the semicolon (;) it must uses the \; instead

The purpose of each part is as follows:

  1. The first part (pattern) is mandatory. It includes the mask characters or string (series of characters) along with placeholders and literal data such as, parentheses, periods, and hyphens.

    The following table lists the placeholder and literal characters for an input mask and explains how it controls data entry:

    • #, a digit, +, - or space (entry not required).
    • 0, a digit (0 through 9, entry required; plus [+] and minus [-] signs not allowed).
    • 9, a digit or space (entry not required; plus and minus signs not allowed).
    • x, a lower case hexa character, [0-9],[a-f] ( entry required )
    • X, an upper case hexa character, [0-9],[A-F] ( entry required )
    • A, any letter, digit (entry required).
    • a, any letter, digit or space (entry optional).
    • L, any letter (entry require).
    • ?, any letter or space (entry optional).
    • &, any character or a space (entry required).
    • C, any character or a space (entry optional).
    • >, any letter, converted to uppercase (entry required).
    • <, any letter, converted to lowercase (entry required).
    • *, any characters combinations
    • { min,max } (Range), indicates a number range. The syntax {min,max} (Range), masks a number in the giving range. The min and max values should be positive integers. For instance the mask {0,255} masks any number between 0 and 255.
    • [...] (Alternative), masks any characters that are contained in the [] brackets. For instance, the [abcdA-D] mask any character: a,b,c,d,A,B,C,D
    • \, indicates the escape character
    • », ( ALT + 175 ) causes the characters that follow to be converted to uppercase, until «( ALT + 174 ) is found.
    • «, ( ALT + 174 ) causes the characters that follow to be converted to lowercase, until »( ALT + 175 ) is found.
    • !, causes the input mask to fill from right to left instead of from left to right.

    Characters enclosed in double quotation ("" or ``) marks will be displayed literally. If this part should display/use the semicolon (;) character is should be included between double quotation ("" or ``) characters or as \; ( escape ).

  2. The second part is optional and refers to the embedded mask characters and how they are stored within the field. If the second part is set to 0 ( default, exClipModeLiteralsNone ), all characters are stored with the data, and if it is set to 1 (exClipModeLiteralsInclude), the literals are stored, not including the masking/placeholder characters, if 2 (exClipModeLiteralsExclude), just typed characters are stored, if 3(exClipModeLiteralsEscape), optional, required, editable and escaped entities are included. No double quoted text is included.
  3. The third part of the input mask is also optional and indicates a single character or space that is used as a placeholder. By default, the field uses the underscore (_). If you want to use another character, enter it in the third part of your mask. Only the first character is considered. If this part should display/use the semicolon (;) character is should be \; ( escape )
  4. The forth part of the input, indicates a list of options that can be applied to input mask, separated by comma(,) character.

    The known options for the forth part are:

    • float, indicates that the field is edited as a decimal number, integer. The first part of the input mask specifies the pattern to be used for grouping and decimal separators, and - if negative numbers are supported. If the first part is empty, the float is formatted as indicated by current regional settings. For instance, "##;;;float" specifies a 2 digit number in float format. The grouping, decimal, negative and digits options are valid if the float option is present.

    • grouping=value, Character used to separate groups of digits to the left of the decimal. Valid only if float is present. For instance ";;;float,grouping=" indicates that no grouping is applied to the decimal number (LOCALE_STHOUSAND)
    • decimal=value, Character used for the decimal separator. Valid only if float is present. For instance ";;;float,grouping= ,decimal=\," indicates that the decimal number uses the space for grouping digits to the left, while for decimal separator the comma character is used (LOCALE_SDECIMAL)
    • negative=value, indicates whether the decimal number supports negative numbers. The value should be 0 or 1. 1 means negative numbers are allowed. Else 0 or missing, the negative numbers are not accepted. Valid only if float is present.
    • digits=value, indicates the max number of fractional digits placed after the decimal separator. Valid only if float is present. For instance, ";;;float,digits=4" indicates a max 4 digits after decimal separator (LOCALE_IDIGITS)
    • password[=value], displays a black circle for any shown character. For instance, ";;;password", specifies that the field to be displayed as a password. If the value parameter is present, the first character in the value indicates the password character to be used. By default, the * password character is used for non-TrueType fonts, else the black circle character is used. For instance, ";;;password=*", specifies that the field to be displayed as a password, and use the * for password character. If the value parameter is missing, the default password character is used.
    • right, aligns the characters to the right. For instance, "(999) 999-9999;;;right" displays and masks a telephone number aligned to the right. readonly, the editor is locked, user can not update the content, the caret is available, so user can copy the text, excepts the password fields.
    • inserttype, indicates that the field enters in insert-type mode, if this is the first option found. If the forth part includes also the overtype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;inserttype,overtype", indicates that the field enter in insert-type mode, and over-type mode is allowed. The "##:##;;0;inserttype", indicates that the field enter in insert-type mode, and over-type mode is not allowed.
    • overtype, indicates that the field enters in over-type mode, if this is the first option found. If the forth part includes also the inserttype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;overtype,inserttype", indicates that the field enter in over-type mode, and insert-type mode is allowed. The "##:##;;0;overtype", indicates that the field enter in over-type mode, and insert-type mode is not allowed.
    • nocontext, indicates that the field provides no context menu when user right clicks the field. For instance, ";;;password,nocontext" displays a password field, where the user can not invoke the default context menu, usually when a right click occurs.
    • beep, indicates whether a beep is played once the user enters an invalid character. For instance, "00:00;;;beep" plays a beep once the user types in invalid character, in this case any character that's not a digit.
    • warning=value, indicates the html message to be shown when the user enters an invalid character. For instance, "00:00:00;;;warning=invalid character" displays a "invalid character" tooltip once the user types in invalid character, in this case any character that's not a digit. The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape )
    • invalid=value, indicates the html message to be displayed when the user enters an inappropriate value for the field. If the value is missing or empty, the option has no effect, so no validation is performed. If the value is a not-empty value, the validation is performed. If the value is single space, no message is displayed and the field is keep opened while the value is inappropriate. For instance, "!(999) 000 0000;;;invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." displays the "The value you entered isn't appropriate for the input mask '...' specified for this field." tooltip once the user leaves the field and it is not-valid ( for instance, the field includes entities required and uncompleted ). The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape ). This option can be combined with empty, validateas.
    • validateas=value, specifies the additional validation is done for the current field. If value is missing or 0 (exValidateAsNone), the option has no effect. The validateas option has effect only if the invalid option specifies a not-empty value. Currently, the value can be 1 (exValidateAsDate), which indicates that the field is validated as a date. For instance, having the mask "!00/00/0000;;0;empty,validateas=1,invalid=Invalid date!,warning=Invalid character!,select=4,overtype", indicates that the field is validate as date ( validateas=1 ).
    • empty, indicates whether the field supports empty values. This option can be used with invalid flag, which indicates that the user can leave the field if it is empty. If empty flag is present, the field displays nothing if no entity is completed ( empty ). Once the user starts typing characters the current mask is displayed. For instance, having the mask "!(999) 000 0000;;;empty,select=4,overtype,invalid=invalid phone number,beep", it specifies an empty or valid phone to be entered.
    • select=value, indicates what to select from the field when it got the focus. The value could be 0 ( nothing, exSelectNoGotFocus ), 1 ( select all, exSelectAllGotFocus ), 2 ( select the first empty and editable entity of the field, exSelectEditableGotFocus ), 3 ( moves the cursor to the beginning of the first empty and editable entity of the field, exMoveEditableGotFocus ), 4 ( select the first empty, required and editable entity of the field, exSelectRequiredEditableGotFocus ), 5 ( moves the cursor to the beginning of the first empty, required and editable entity of the field, exMoveRequiredEditableGotFocus ). For modes 2 and 4 the entire field is selected if no matching entity is found. For instance, "`Time:`XX:XX;;;select=1" indicates that the entire field ( including the Time: prefix ) is selected once it get the focus. The "`Time:`XX:XX;;;select=3", moves the cursor to first X, if empty, the second if empty, and so on

Experimental:
multiline, specifies that the field supports multiple lines.
rich, specifies that the field displays a rich type editor. By default, the standard edit field is shown
disabled, shows as disabled the field.

Masking-Float, (mask, float option)

The [mask=<VALUE>] property may indicate the followings, if the [float=-1] is present
  • negative number: if the first character in the mask is - ( minus ) the control supports negative numbers. Pressing the - key will toggle the sign of the number. The + sign is never displayed.
  • decimal symbol: the last character that's different than # ( digit ), or 0 (zero) indicates the decimal symbol. If it is not present the control mask a floating point number without decimals.
  • thousand symbol: the thousand symbol is the last character that's not a # ( digit ), 0 (zero) or it is not the decimal symbol as explained earlier, if present.
  • the maximum number of decimals in the number ( the # or 0 character after the decimal symbol )
  • the maximum number of digits in the integer part ( the number of # or 0 character before decimal symbol )
  • the 0 character indicates a leading-zero. The count of 0 (zero) characters before decimal character indicates the leading-zero for integer part of the control, while the count of 0 (zero) characters after the decimal separator indicates the leading-zero for decimal part of the control. For instance, the Mask on "-###,###,##0.00", while the control's Text property is 1, the control displays 1.00, if 1.1 if displays 1.10, and if empty, the 0.00 is displayed.

If the <VALUE> property is empty, the control takes the settings for the regional options like: Decimal Symbol , No. of digits after decimal, Digit grouping symbol.

Here are few samples:

The <VALUE>"-###.###.##0,00" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator ). This format displays leading-zeros.

The <VALUE>"-###.###.###,##" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator )

The <VALUE>"-###,###,###.##" filter floating point numbers a number for English settings ( "." is the decimal sign, "," is the thousands separator )

The <VALUE>"####" indicates a max-4 digit number ( positive ) without a decimal symbol and without digit grouping

The <VALUE>"-##.#" filters a floating point number from the -99.9 to 99.9 ( "." is the decimal sign, no thousands separator )

The <VALUE>"#,###.##" filters a floating point number from the 0 to 9,999.99 with digit grouping ( "." is the decimal sign, "," is the thousands separator ).

Tick Label Expression, (ticklabel option)

For instance:

  • "value", shows the values for each tick.
  • " (value=current ? '<font ;12><fgcolor=FF0000>' : '' ) + value", shows the current slider's position with a different color and font.
  • "value = current ? value : ''", shows the value for the current tick only.
  • "( value = current ? '<b><font ;10>' : '' ) + (value array 'ab bc cd de ef fg gh hi ij jk kl' split ' ')" displays different captions for slider's values.

The The <VALUE> of [ticklabel] option is a formatted expression which result may include the HTML tags.

The The <VALUE> of [ticklabel] option indicates a formatting expression that may use the following predefined keywords:

  • value gets the slider's position to be displayed
  • current gets the current slider's value.
  • vmin gets the slider's minimum value.
  • vmax gets the slider's maximum value.
  • smin gets the slider's selection minimum value.
  • smax gets the slider's selection maximum value.

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for is

"expression ? true_part : false_part"

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

"expression array (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')".

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

"expression in (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

"expression switch (default,c1,c2,c3,...,cn)"

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:

    • #4/1/2009#, from hours 06:00 AM to 12:00 PM
    • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
    • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.

Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%0) = 8 specifies the cells that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string
  • dbl (unary operator) converts the expression to a number
  • date (unary operator) converts the expression to a date, based on your regional settings
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS.

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string
  • lower (unary operator) returns a string expression in lowercase letters
  • upper (unary operator) returns a string expression in uppercase letters
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names
  • ltrim (unary operator) removes spaces on the left side of a string
  • rtrim (unary operator) removes spaces on the right side of a string
  • trim (unary operator) removes spaces on both sides of a string
  • startwith (binary operator) specifies whether a string starts with specified string
  • endwith (binary operator) specifies whether a string ends with specified string
  • contains (binary operator) specifies whether a string contains another specified string
  • left (binary operator) retrieves the left part of the string
  • right (binary operator) retrieves the right part of the string
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on )
  • a count b (binary operator) retrieves the number of occurrences of the b in a
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result.
  • a split b, splits the a using the separator b, and returns an array. For instance, the "weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' '" gets the weekday as string. This operator can be used with the array

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel.
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance the timeF(1:23 PM) returns "13:23:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel.
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance the shortdateF(December 31, 1971 11:00 AM) returns "12/31/1971".
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format.
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel.
  • year (unary operator) retrieves the year of the date (100,...,9999)
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 )
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 )
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 )
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday )
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 )
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 )
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 )

The The <VALUE> of [ticklabel] option can display labels using the following built-in HTML tags:

  • <b>…</b> displays the text in bold.
  • <i>…</i> displays the text in italics.
  • <u>…</u> underlines the text.
  • <s>…</s> Strike-through text
  • <font face;size>…</font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor=RRGGBB>…</fgcolor> displays text with a specified foreground color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <bgcolor=RRGGBB>…</bgcolor> displays text with a specified background color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <br> a forced line-break
  • <solidline> The next line shows a solid-line on top/bottom side. If has no effect for a single line caption.
  • <dotline> The next line shows a dot-line on top/bottom side. If has no effect for a single line caption.
  • <upline> The next line shows a solid/dot-line on top side. If has no effect for a single line caption.
  • <r> Right aligns the text
  • <c> Centers the text
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number ( the character with specified code ), For instance, the &#8364 displays the EUR character, in UNICODE configuration. The & ampersand is only recognized as markup when it is followed by a known letter or a # character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;

EBN String Format, (itemsbgext option)

The EBN String Format syntax in BNF notation is defined like follows:

<EBN> ::= <elements> | <root> "(" [<elements>] ")"
<elements> ::= <element> [ "," <elements> ]
<root> ::= "root" [ <attributes> ] | [ <attributes> ]
<element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ]
<anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom"
<attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]"
<client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression>
<expression> ::= <number> | <number> "%"
<attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others>
<equal> ::= "="
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<decimal> ::= <digit><decimal>
<hexadigit> ::= <digit> | "A" | "B"  "C" | "D" | "E"  "F"
<hexa> ::= <hexadigit><hexa>
<number> ::= <decimal> | "0x" <hexa>
<color> ::= <rgbcolor> | number
<rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")"
<string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> "
<characters> ::= <char>|<characters>
<char> ::= <any_character_excepts_null>
<backcolor> ::= "back" <equal> <color>
<text> ::= "text" <equal> <string>
<align> ::= "align" <equal> <number>
<pattern> ::= "pattern" <equal> <number>
<patterncolor> ::= "patterncolor" <equal> <color>
<frame> ::= "frame" <equal> <color>
<data> ::= "data" <equal> <number> | <string>
<framethick> ::= "framethick"
<wordwrap> ::= "wordwrap"

Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.

Here's a few easy samples:

  • "[pattern=6]", shows the BDiagonal pattern on the object's background.

  • "[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.

  • "[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.

  • "[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:

  • "top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.

  • "[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.

  • "[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.

  • "left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.

  • "bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.

  • "root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side


property VisibleItemsCount

property Items.VisibleItemsCount as Long
Specifies the maximum number of visible items at one time.

Type | Description
Long | A long expression that indicates the maximum number of visible items into the popup menu.
By default, the VisibleItemCount property is 12. The control adds scroll buttons to a popup menu, if the menu contains more items than VisibleItemsCount property. Use the Visible property to specify whether an item is visible or hidden. Use the Add method to add new items to the control. The VisibleItemsCount property specifies the number of items being visible without scroll option.


OleEvent object

The OleEvent object holds information about an event fired by an ActiveX control hosted by in item that was created using the Add(,SubControl) method.

Name | Description
CountParam | Retrieves the count of the OLE event's arguments.
ID | Retrieves a long expression that specifies the identifier of the event.
Name | Retrieves the original name of the fired event.
Param | Retrieves an OleEventParam object given either the index of the parameter, or its name.
ToString | Retrieves information about the event.


property CountParam

property OleEvent.CountParam as Long

Retrieves the count of the OLE event's arguments.

Type | Description
Long | A long value that indicates the count of the arguments.
Use the CountParam property to count the parameters of an OLE event. Use the Name property to get the parameter name. Use the Param property to get the event's parameter. Use the Value property to specify the value of the parameter.


property ID

property OleEvent.ID as Long
Retrieves a long expression that specifies the identifier of the event.

Type | Description
Long | A Long expression that defines the identifier of the OLE event.
The identifier of the event could be used to identify a specified OLE event. Use the Name property of the OLE Event to get the name of the OLE Event. Use the ToString property to display information about an OLE event. The ToString property displays the idenfier of the event after the name of the event in two [] brackets. For instance, the ToString property gets the "KeyDown[-602](KeyCode/Short* = 9,Shift/Short = 0)" when TAB key is pressed, so the identifier of the KeyDown event being fired by the inside User editor is -602.


property Name

property OleEvent.Name as String

Retrieves the original name of the fired event.

Type | Description
String | A string expression that indicates the event's name.
Use the Name property to get the name of the event. Use the ID property to specify a specified even by its identifier. Use the ToString property to display information about fired event such us name, parameters, types and values. Use the CountParam property to count the parameters of an OLE event. Use the Param property to get the event's parameter. Use the Value property to specify the value of the parameter.


property Param

property OleEvent.Param (Item as Variant) as OleEventParam

Retrieves an OleEventParam object given either the index of the parameter, or its name.

Type | Description
Item as Variant | A long expression that indicates the argument's index or a a string expression that indicates the argument's name.
OleEventParam | An OleEventParam object that holds information about a parameter of an event.
Use the CountParam property to count the parameters of an OLE event. Use the Name property to get the parameter name. Use the Param property to get the event's parameter. Use the Value property to specify the value of the parameter.


property ToString

property OleEvent.ToString as String
Retrieves information about the event.

Type | Description
String | A String expression that shows information about an OLE event. The ToString property gets the information as follows: Name[ID] (Param/Type = Value, Param/Type = Value, ... ). For instance, "KeyDown[-602](KeyCode/Short* = 9,Shift/Short = 0)" indicates that the KeyDown event is fired, with the identifier -602 with two parameters KeyCode as a reference to a short type with the value 8, and Shift parameter as Short type with the value 0.
Use the ToString property to display information about fired event such us name, parameters, types and values. Using the ToString property you can quickly identifies the event that you should handle in your application. Use the ID property to specify a specified even by its identifier. Use the Name property to get the name of the event. Use the Param property to access a specified parameter using its index or its name.

Displaying ToString property during the OLE Event event may show data like follows:

MouseMove[-606](Button/Short = 0,Shift/Short = 0,X/Long = 46,Y/Long = 15)
MouseDown[-605](Button/Short = 1,Shift/Short = 0,X/Long = 46,Y/Long = 15)
KeyDown[-602](KeyCode/Short* = 83,Shift/Short = 0)
KeyPress[-603](KeyAscii/Short* = 115)
Change[2]()
KeyUp[-604](KeyCode/Short* = 83,Shift/Short = 0)
MouseUp[-607](Button/Short = 1,Shift/Short = 0,X/Long = 46,Y/Long = 15)
MouseMove[-606](Button/Short = 0,Shift/Short = 0,X/Long = 46,Y/Long = 15)


OleEventParam object

The OleEventParam holds the name and the value for an event's argument.

Name | Description
Name | Retrieves the name of the event's parameter.
Value | Retrieves the value of the event's parameter.


property Name

property OleEventParam.Name as String

Retrieves the name of the event's parameter.

Type | Description
String | A string expression that indicates the name of the event's parameter.
Use the CountParam property to count the parameters of an OLE event. Use the Name property to get the parameter name. Use the Param property to get the event's parameter. Use the Value property to specify the value of the parameter.


property Value

property OleEventParam.Value as Variant

Specifies the value of the event's parameter.

Type | Description
Variant | A variant value that indicates the value of the event's parameter.
Use the CountParam property to count the parameters of an OLE event. Use the Name property to get the parameter name. Use the Param property to get the event's parameter. Use the Value property to specify the value of the parameter.


ToolBar object
Tip The /COM object can be placed on a HTML page (with usage of the HTML object tag: <object classid="clsid:...">) using the class identifier: {8A047308-84CB-4B50-90D7-AFD27BB4639C}. The object's program identifier is: "Exontrol.ToolBar". The /COM object module is: "ExToolBar.dll"
The eXToolBar component, similar with the Microsoft Office's "Fluent User Interface", or ToolBar, allows you to display graphical control elements in the form of a set of toolbars placed on several tabs. The eXToolBar component is written from scratch, uses EBN technology to let the user changes its visual appearance using skins, and requires no dependencies to Microsoft Office, Microsoft ToolBar API, or any other third party library. The major difference between our toolbar implementation and others, is that you can display and use built-editors ( like sliders, spin, progress, ... ) anywhere on the control. The control supports the following properties and methods:

Name | Description
AllowCopyTemplate | Specifies whether the Shift + Ctrl + Alt + Insert sequence copies the control's content to the clipboard, in template form.
AllowToggleRadio | Allows or prevents toggling the radio state.
AllowToolTip | Allows or prevents showing the item's tooltip.
Appearance | Retrieves or sets the popup's appearance.
ArrangeItemsAs | Specifies the how the items are arranged on the toolbar.
AttachTemplate | Attaches a script to the current object, including the events, from a string, file, a safe array of bytes.
BackColor | Specifies the control's background color.
Background | Returns or sets a value that indicates the background color for parts in the control.
Cursor | Gets or sets the cursor that is displayed when the mouse pointer hovers the control.
Debug | Retrieves or sets a value that indicating whether the item's identifier is visible.
Enabled | Enables or disables the control.
EventParam | Retrieves or sets a value that indicates the current's event parameter.
ExecuteTemplate | Executes a template and returns the result.
Font | Retrieves or sets the control's font.
ForeColor | Specifies the control's foreground color.
Get | Retrieves an array of Item objects that meet the criteria.
GetChecked | Retrieves an array of Item objects, that displays a check box which is checked.
GetRadio | Retrieves an array of Item objects of radio type in the same group, that are checked.
GetUnchecked | Retrieves an array of Item objects, that displays a check box which is unchecked.
HTMLPicture | Adds or replaces a picture in HTML captions.
hWnd | Retrieves the control's window handle.
Images | Sets at runtime the control's image list. The Handle should be a handle to an Images List Control.
ImageSize | Retrieves or sets the size of icons the control displays.
Item | Returns a specific Item object giving its identifier or caption.
ItemFromPoint | Retrieves the item from the cursor.
Items | Retrieves the control's Items collection.
LocalAppearance | Retrieves or sets the local popup's appearance.
Locked | Locks or unlocks the control.
Notifier | Retrieves or sets the handle of the window that receives notifications/WM_COMMAND messages.
Picture | Retrieves or sets a graphic to be displayed in the control.
PictureDisplay | Retrieves or sets a value that indicates the way how the graphic is displayed on the control's background
PopupAppearance | Retrieves or sets the popup's appearance.
PopupFlatAppearance | Specifies whether the control shows a flat appearance for sub-menus.
PopupFlatBackColor | Specifies the background color to show the left part of the flat sub-menus.
PopupFlatImageWidth | Specifies the width of the flat portion of the sub-menu, in pixels.
PopupIncrementalSearch | Specifies how the popup searches for the objects while user types characters.
PopupVisibility | Specify the popup's visibility in percents: 90% is barely visible, and 10% is nearly opaque.
Refresh | Refreses the control.
ReplaceIcon | Adds a new icon, replaces an icon or clears the control's image list.
RequiredHeight | Indicates the height to fit all elements within the control.
RequiredWidth | Indicates the width to fit all elements within the control.
SelBackColor | Retrieves or sets a value that indicates the selection background color.
SelForeColor | Retrieves or sets a value that indicates the selection foreground color.
ShortcutKeyAlignH | Defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.
ShortcutKeyAlignV | Defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items vertically.
ShortcutKeyExtPaddingH | Specifies the padding to be applied to the item (arranged horizontally) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.
ShortcutKeyExtPaddingV | Specifies the padding to be applied to the item (arranged vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.
ShortcutKeyFormat | Specifies the expression that determines the format (including HTML tags) to display the shortcut keys.
ShortcutKeyPadding | Specifies the UI shortcut key's content padding.
ShortcutKeyPressedModifers | Indicates the combination of modifier keys whose shortcut keys are currently visible.
ShortcutKeysInfo | Returns the list of shortcut keys that are currently available.
ShortcutKeyTransparent | Indicates the percent of transparency the shortcut keys are being displayed with.
ShortcutKeyVisible | Gets or sets a value that specifies whether the control's shortcut keys are visible or hidden.
ShowCheckedAsSelected | Specifies whether the checked items shows as selected.
ShowImageList | Specifies whether the control's image list window is visible or hidden.
ShowPopupArrow | Indicates the type of the arrow to be shown when the item displays the sub-menu.
ShowPopupEffect | Specifies the effect to show the popup menu when clicking an item, such as scrolling, lighting up, and so on.
ShowToolTip | Shows the specified tooltip at given position.
Template | Specifies the control's template.
TemplateDef | Defines inside variables for the next Template/ExecuteTemplate call.
TemplatePut | Defines inside variables for the next Template/ExecuteTemplate call.
ToolTipDelay | Specifies the time in ms that passes before the ToolTip appears.
ToolTipFont | Retrieves or sets the tooltip's font.
ToolTipPopDelay | Specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control.
ToolTipWidth | Specifies a value that indicates the width of the tooltip window, in pixels.
ToString | Loads or saves the Items collection using string representation (shortcut of Items.ToString property).
ToTemplate | Generates the control's template.
Update | Updates the control.
UseVisualTheme | Specifies whether the control uses the current visual theme to display certain UI parts.
Version | Retrieves the control's version.
VisualAppearance | Retrieves the control's appearance.


property AllowCopyTemplate

property ToolBar.AllowCopyTemplate as Boolean
Specifies whether the Shift + Ctrl + Alt + Insert sequence copies the control's content to the clipboard, in template form.

Type | Description
Boolean | A Boolean expression that specifies whether the Shift + Ctrl + Alt + Insert sequence copies the control's content to the clipboard, in template form.
By default, the AllowCopyTemplate property is True, which indicates that you can copy the toolbar's content in x-script format by pressing the Shift + Ctrl + Alt + Insert keys combination. If the function succeeded the generated x-script code is copied to your clipboard and a beep is played. In order to execute the generated code, you can use the eXHelper tool. Based on x-script, the exHelper tool can generate code in different programming languages such as C++, VB, Delphi, and much more. The Template / ExecuteTemplate can be used to execute the x-script being generated. The ToTemplate property generates x-script from the control's content.


property AllowToggleRadio

property ToolBar.AllowToggleRadio as Boolean
Allows or prevents toggling the radio state.

Type | Description
Boolean | A Boolean expression that specifies whether the radio-buttons allow toggling its value.
By default, the AllowToggleRadio property is False. The AllowToggleRadio property on True, allows a radio button to set on zero ( unchecked ), if the user clicks twice the radio button. Usually, clicking a radio-button makes the previously checked radio-button in the same group, to be un-checked, and the newly clicked item to be checked. Now, if the AllowToggleRadio property is True, clicking again the radio-button, allows the radio-button to be un-checked, so allows a radio group to have no radio button checked. The control fires the CheckItem event once a radio-button is clicked. The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked. The Checked property specifies whether the item is checked or un-checked. The GetRadio method gets a safe array with the radio-items being checked within a radio group. Use the Background(exRadioButtonState0)/Background(exRadioButtonState1) property to specify the visual appearance of the radio-buttons in the control. Use the UseVisualTheme property to specify whether the visual appearance for the radio-buttons to be as indicated by the current XP theme.

I am using radio-buttons, the question is it possible to uncheck the radio-buttons, so no button is pressed in the group?

VBA (MS Access, Excell...)

With ToolBar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .AllowToggleRadio = True
    With .Items
        With .Add("Radio 1",0,1000)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1001)
            .Radio = True
            .RadioGroup = 100
        End With
        With .Add("Radio 2",0,1003)
            .Radio = True
            .RadioGroup = 100
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutAllowToggleRadio(VARIANT_TRUE);
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Radio 1",long(0),long(1000));
        var_Item->PutRadio(VARIANT_TRUE);
        var_Item->PutRadioGroup(100);
    EXTOOLBARLib::IItemPtr var_Item1 = var_Items->Add(L"Radio 2",long(0),long(1001));
        var_Item1->PutRadio(VARIANT_TRUE);
        var_Item1->PutRadioGroup(100);
    EXTOOLBARLib::IItemPtr var_Item2 = var_Items->Add(L"Radio 2",long(0),long(1003));
        var_Item2->PutRadio(VARIANT_TRUE);
        var_Item2->PutRadioGroup(100);
spToolBar1->Refresh();

C++ Builder

ToolBar1->AllowToggleRadio = true;
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Radio 1",TVariant(0),TVariant(1000));
        var_Item->Radio = true;
        var_Item->RadioGroup = 100;
    Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items->Add(L"Radio 2",TVariant(0),TVariant(1001));
        var_Item1->Radio = true;
        var_Item1->RadioGroup = 100;
    Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items->Add(L"Radio 2",TVariant(0),TVariant(1003));
        var_Item2->Radio = true;
        var_Item2->RadioGroup = 100;
ToolBar1->Refresh();

C#

extoolbar1.AllowToggleRadio = true;
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Radio 1",0,1000);
        var_Item.Radio = true;
        var_Item.RadioGroup = 100;
    exontrol.EXTOOLBARLib.Item var_Item1 = var_Items.Add("Radio 2",0,1001);
        var_Item1.Radio = true;
        var_Item1.RadioGroup = 100;
    exontrol.EXTOOLBARLib.Item var_Item2 = var_Items.Add("Radio 2",0,1003);
        var_Item2.Radio = true;
        var_Item2.RadioGroup = 100;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.AllowToggleRadio = true;
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Radio 1",0,1000);
            var_Item.Radio = true;
            var_Item.RadioGroup = 100;
        var var_Item1 = var_Items.Add("Radio 2",0,1001);
            var_Item1.Radio = true;
            var_Item1.RadioGroup = 100;
        var var_Item2 = var_Items.Add("Radio 2",0,1003);
            var_Item2.Radio = true;
            var_Item2.RadioGroup = 100;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .AllowToggleRadio = True
        With .Items
            With .Add("Radio 1",0,1000)
                .Radio = True
                .RadioGroup = 100
            End With
            With .Add("Radio 2",0,1001)
                .Radio = True
                .RadioGroup = 100
            End With
            With .Add("Radio 2",0,1003)
                .Radio = True
                .RadioGroup = 100
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.AllowToggleRadio = true;
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Radio 1",0,1000);
        var_Item.Radio = true;
        var_Item.RadioGroup = 100;
    EXTOOLBARLib.Item var_Item1 = var_Items.Add("Radio 2",0,1001);
        var_Item1.Radio = true;
        var_Item1.RadioGroup = 100;
    EXTOOLBARLib.Item var_Item2 = var_Items.Add("Radio 2",0,1003);
        var_Item2.Radio = true;
        var_Item2.RadioGroup = 100;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Item2,com_Items;
    anytype var_Item,var_Item1,var_Item2,var_Items;
    ;

    super();

    extoolbar1.AllowToggleRadio(true);
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Radio 1",COMVariant::createFromInt(0),COMVariant::createFromInt(1000)); com_Item = var_Item;
            com_Item.Radio(true);
            com_Item.RadioGroup(100);
        var_Item1 = com_Items.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1001)); com_Item1 = var_Item1;
            com_Item1.Radio(true);
            com_Item1.RadioGroup(100);
        var_Item2 = com_Items.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1003)); com_Item2 = var_Item2;
            com_Item2.Radio(true);
            com_Item2.RadioGroup(100);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    AllowToggleRadio := True;
    with Items do
    begin
        with Add('Radio 1',TObject(0),TObject(1000)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',TObject(0),TObject(1001)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',TObject(0),TObject(1003)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    AllowToggleRadio := True;
    with Items do
    begin
        with Add('Radio 1',OleVariant(0),OleVariant(1000)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',OleVariant(0),OleVariant(1001)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
        with Add('Radio 2',OleVariant(0),OleVariant(1003)) do
        begin
            Radio := True;
            RadioGroup := 100;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .AllowToggleRadio = .T.
    with .Items
        with .Add("Radio 1",0,1000)
            .Radio = .T.
            .RadioGroup = 100
        endwith
        with .Add("Radio 2",0,1001)
            .Radio = .T.
            .RadioGroup = 100
        endwith
        with .Add("Radio 2",0,1003)
            .Radio = .T.
            .RadioGroup = 100
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.AllowToggleRadio = true
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Radio 1",0,1000)
        var_Item.Radio = true
        var_Item.RadioGroup = 100
    var_Item1 = var_Items.Add("Radio 2",0,1001)
        var_Item1.Radio = true
        var_Item1.RadioGroup = 100
    var_Item2 = var_Items.Add("Radio 2",0,1003)
        var_Item2.Radio = true
        var_Item2.RadioGroup = 100
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.AllowToggleRadio = .t.
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Radio 1",0,1000)
        var_Item.Radio = .t.
        var_Item.RadioGroup = 100
    var_Item1 = var_Items.Add("Radio 2",0,1001)
        var_Item1.Radio = .t.
        var_Item1.RadioGroup = 100
    var_Item2 = var_Items.Add("Radio 2",0,1003)
        var_Item2.Radio = .t.
        var_Item2.RadioGroup = 100
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1,var_Item2 as IItem
local var_Items as IItems

oDCOCX_Exontrol1:AllowToggleRadio := true
var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Radio 1",0,1000)
        var_Item:Radio := true
        var_Item:RadioGroup := 100
    var_Item1 := var_Items:Add("Radio 2",0,1001)
        var_Item1:Radio := true
        var_Item1:RadioGroup := 100
    var_Item2 := var_Items:Add("Radio 2",0,1003)
        var_Item2:Radio := true
        var_Item2:RadioGroup := 100
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Items

oToolBar = ole_1.Object
oToolBar.AllowToggleRadio = true
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Radio 1",0,1000)
        var_Item.Radio = true
        var_Item.RadioGroup = 100
    var_Item1 = var_Items.Add("Radio 2",0,1001)
        var_Item1.Radio = true
        var_Item1.RadioGroup = 100
    var_Item2 = var_Items.Add("Radio 2",0,1003)
        var_Item2.Radio = true
        var_Item2.RadioGroup = 100
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Set ComAllowToggleRadio to True
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Radio 1" 0 1000 to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComRadio of hoItem to True
            Set ComRadioGroup of hoItem to 100
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Radio 2" 0 1001 to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComRadio of hoItem1 to True
            Set ComRadioGroup of hoItem1 to 100
        Send Destroy to hoItem1
        Variant voItem2
        Get ComAdd of hoItems "Radio 2" 0 1003 to voItem2
        Handle hoItem2
        Get Create (RefClass(cComItem)) to hoItem2
        Set pvComObject of hoItem2 to voItem2
            Set ComRadio of hoItem2 to True
            Set ComRadioGroup of hoItem2 to 100
        Send Destroy to hoItem2
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1,oItem2
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:AllowToggleRadio := .T.
        oItems := oToolBar:Items()
            oItem := oItems:Add("Radio 1",0,1000)
                oItem:Radio := .T.
                oItem:RadioGroup := 100
            oItem1 := oItems:Add("Radio 2",0,1001)
                oItem1:Radio := .T.
                oItem1:RadioGroup := 100
            oItem2 := oItems:Add("Radio 2",0,1003)
                oItem2:Radio := .T.
                oItem2:RadioGroup := 100
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property AllowToolTip

property ToolBar.AllowToolTip as Boolean
Allows or prevents showing the item's tooltip.

Type | Description
Boolean | A Boolean expression that specifies whether the control displays the item's tooltip when the cursor hovers the item.
By default, the AllowToolTip property is True. Use the AllowToolTip property on False, to prevent shown the item's tooltip when the cursor hovers the item. The Tooltip property assigns a HTML tooltip to an item, that's displayed only when the cursor hovers the item. The TooltipTitle property specifies the title for the item's tooltip. The TooltipDelay property specifies the time until the tooltip is shown. Use the ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. Use the ToolTipWidth property to specify the width of the tooltip window. The ToolTipFont property specifies the tooltip's font. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color.

How do I disable showing the tooltip for all control?

VBA (MS Access, Excell...)

With ToolBar1
    .AllowToolTip = False
    With .Items
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    End With
    .Refresh
End With

VB6

With ToolBar1
    .AllowToolTip = False
    With .Items
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .AllowToolTip = False
    With .Items
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .AllowToolTip = False
    With .Items
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutAllowToolTip(VARIANT_FALSE);
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutTooltip(L"this is a bit of text to be shown when cursor hovers it");
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutTooltip(L"this is a bit of text to be shown when cursor hovers it");
spToolBar1->Refresh();

C++ Builder

ToolBar1->AllowToolTip = false;
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Tooltip = L"this is a bit of text to be shown when cursor hovers it";
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Tooltip = L"this is a bit of text to be shown when cursor hovers it";
ToolBar1->Refresh();

C#

extoolbar1.AllowToolTip = false;
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Tooltip = "this is a bit of text to be shown when cursor hovers it";
    var_Items.Add("Item",null,null).Tooltip = "this is a bit of text to be shown when cursor hovers it";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.AllowToolTip = false;
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Tooltip = "this is a bit of text to be shown when cursor hovers it";
        var_Items.Add("Item",null,null).Tooltip = "this is a bit of text to be shown when cursor hovers it";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .AllowToolTip = False
        With .Items
            .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
            .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.AllowToolTip = false;
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Tooltip = "this is a bit of text to be shown when cursor hovers it";
    var_Items.Add("Item",null,null).Tooltip = "this is a bit of text to be shown when cursor hovers it";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    extoolbar1.AllowToolTip(false);
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Tooltip("this is a bit of text to be shown when cursor hovers it");
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Tooltip("this is a bit of text to be shown when cursor hovers it");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    AllowToolTip := False;
    with Items do
    begin
        Add('Item',Nil,Nil).Tooltip := 'this is a bit of text to be shown when cursor hovers it';
        Add('Item',Nil,Nil).Tooltip := 'this is a bit of text to be shown when cursor hovers it';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    AllowToolTip := False;
    with Items do
    begin
        Add('Item',Null,Null).Tooltip := 'this is a bit of text to be shown when cursor hovers it';
        Add('Item',Null,Null).Tooltip := 'this is a bit of text to be shown when cursor hovers it';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .AllowToolTip = .F.
    with .Items
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
        .Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.AllowToolTip = false
var_Items = oToolBar.Items
    // var_Items.Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Tooltip = "this is a bit of text to be shown when cursor hovers it"]
    endwith
    // var_Items.Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    var_Item1 = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.Tooltip = "this is a bit of text to be shown when cursor hovers it"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.AllowToolTip = .f.
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Tooltip = \"this is a bit of text to be shown when cursor hovers it\""

    ' var_Items.Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    var_Item1 = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.Tooltip = \"this is a bit of text to be shown when cursor hovers it\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

oDCOCX_Exontrol1:AllowToolTip := false
var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Tooltip := "this is a bit of text to be shown when cursor hovers it"
    var_Items:Add("Item",nil,nil):Tooltip := "this is a bit of text to be shown when cursor hovers it"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
oToolBar.AllowToolTip = false
var_Items = oToolBar.Items
    var_Items.Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
    var_Items.Add("Item").Tooltip = "this is a bit of text to be shown when cursor hovers it"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Set ComAllowToolTip to False
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComTooltip of hoItem to "this is a bit of text to be shown when cursor hovers it"
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComTooltip of hoItem1 to "this is a bit of text to be shown when cursor hovers it"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:AllowToolTip := .F.
        oItems := oToolBar:Items()
            oItems:Add("Item"):Tooltip := "this is a bit of text to be shown when cursor hovers it"
            oItems:Add("Item"):Tooltip := "this is a bit of text to be shown when cursor hovers it"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Appearance

property ToolBar.Appearance as ToolBarAppearanceEnum
Retrieves or sets the control's appearance.

Type | Description
ToolBarAppearanceEnum | A ToolBarAppearanceEnum expression that specifies the menu's frame appearance, or a color expression whose last 7 bits in the high significant byte of the value indicates the index of the skin in the Appearance collection, being displayed as control's borders. For instance, if the Appearance = 0x1000000, indicates that the first skin object in the Appearance collection defines the control's border. The Client object in the skin, defines the client area of the control. The list/hierarchy, scrollbars are always shown in the control's client area. The skin may contain transparent objects, and so you can define round corners. The normal.ebn file contains such of objects. Use the eXButton's Skin builder to view or change this file
By default, the Appearance property is ShadowBorder. The Appearance property specifies the menu's frame appearance. The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The BackColor property specifies the control's background color. The Background property specifies the visual appearance for different parts of the control, including the radio-buttons, check-boxes or separator items. The LocalAppearance property specifies the visual appearance of the local popup. The PopupAppearance specifies a different visual appearance for the current submenu. When using EBN appearance, using the PopupAppearance, LocalAppearance or Appearance, the distance between margins/borders and items client area is indicated by the client object of the skin/ebn object.

The following screen shot shows the control's frame as displayed by default:

The following screen shot shows the control's frame using a different EBN file:


property ArrangeItemsAs

property ToolBar.ArrangeItemsAs as ArrangeItemsEnum
Specifies the how the items are arranged on the toolbar.

Type | Description
ArrangeItemsEnum | An ArrangeItemsEnum expression that determines how the items are arranged on the toolbar.
By default, the ArrangeItemsAs property is exArrangeItemsDefault, which makes the items to be arranged from top to bottom. The X / Y property indicates the x / y-coordinate of the item relative to the control's view. For instance, the ArrangeItemsAs property on exArrangeItemsHorizontal + exArrangeItemsWrap, aligns the items from left to right, and if the last item on the row does not fit on the line, it will be arranged on the next line and so on.

Let's say we have the following buttons on the toolbar:

The following screen shots show how the items are arranged based on different values of ArrangeItemsAs property:

  • exArrangeItemsDefault, exArrangeItemsVertical,

  • exArrangeItemsHorizontal,

  • exArrangeItemsHorizontal + exArrangeItemsWrap,

  • exArrangeItemsHorizontal + exArrangeItemsWrap,


method AttachTemplate

method ToolBar.AttachTemplate (Template as Variant)
Attaches a script to the current object, including the events, from a string, file, a safe array of bytes.

Type | Description
Template as Variant | A string expression that specifies the Template to execute.
The AttachTemplate/x-script code is a simple way of calling control/object's properties, methods/events using strings. The AttachTemplate features allows you to attach a x-script code to the component. The AttachTemplate method executes x-script code ( including events ), from a string, file or a safe array of bytes. This feature allows you to run any x-script code for any configuration of the component /COM, /NET or /WPF. Exontrol owns the x-script implementation in its easiest form and it does not require any VB engine or whatever to get executed. The x-script code can be converted to several programming languages using the eXHelper tool.

The following sample opens the Windows Internet Explorer once the user clicks the control ( /COM version ):

AttachTemplate("handle Click(){ CreateObject(`internetexplorer.application`){ Visible = True; Navigate(`https://www.exontrol.com`) } } ")

This script is equivalent with the following VB code:

Private Sub ToolBar1_Click()
    With CreateObject("internetexplorer.application")
        .Visible = True
        .Navigate ("https://www.exontrol.com")
    End With
End Sub

The AttachTemplate/x-script syntax in BNF notation is defined like follows:

<x-script> := <lines>
<lines> := <line>[<eol> <lines>] | <block>
<block> := <call> [<eol>] { [<eol>] <lines> [<eol>] } [<eol>]
<eol> := ";" | "\r\n"
<line> := <dim> | <createobject> | <call> | <set> | <comment> | <handle>[<eol>]{[<eol>]<lines>[<eol>]}[<eol>]
<dim> := "DIM" <variables>
<variables> := <variable> [, <variables>]
<variable> := "ME" | <identifier>
<createobject> := "CREATEOBJECT(`"<type>"`)"
<call> := <variable> | <property> | <variable>"."<property> | <createobject>"."<property>
<property> := [<property>"."]<identifier>["("<parameters>")"]
<set> := <call> "=" <value>
<property> := <identifier> | <identifier>"("[<parameters>]")"
<parameters> := <value> [","<parameters>]
<value> := <boolean> | <number> | <color> | <date> | <string> | <createobject> | <call>
<boolean> := "TRUE" | "FALSE"
<number> := "0X"<hexa> | ["-"]<integer>["."<integer>]
<digit10> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<digit16> := <digit10> | A | B | C | D | E | F
<integer> := <digit10>[<integer>]
<hexa> := <digit16>[<hexa>]
<color> := "RGB("<integer>","<integer>","<integer>")"
<date> := "#"<integer>"/"<integer>"/"<integer>" "[<integer>":"<integer>":"<integer>"]"#"
<string> := '"'<text>'"' | "`"<text>"`"
<comment> := "'"<text>
<handle> := "handle " <event>
<event> := <identifier>"("[<eparameters>]")"
<eparameters> := <eparameter> [","<eparameters>]
<parameters> := <identifier>

where:

<identifier> indicates an identifier of the variable, property, method or event, and should start with a letter.
<type> indicates the type the CreateObject function creates, as a progID for /COM version or the assembly-qualified name of the type to create for /NET or /WPF version
<text> any string of characters

The Template or x-script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline characters ) or ";" character.

The advantage of the AttachTemplate relative to Template / ExecuteTemplate is that the AttachTemplate can add handlers to the control events.


property BackColor

property ToolBar.BackColor as Color
Specifies the control's background color.

Type | Description
Color | A Color expression that indicates the control's background color.
The BackColor property specifies the control's background color. Use the PopupFlatBackColor property to specify the background color of the left side of the control. The ForeColor property specifies the control's foreground color. The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The SelForeColor property specifies the foreground color of the item being selected / highlighted. The Background property specifies the visual appearance for different parts of the control. The Appearance property specifies the menu's frame appearance. The BackColor property of the Item object specifies a different background color / visual appearance for the entire item.


property Background

property ToolBar.Background(Part as BackgroundPartEnum) as Color
Returns or sets a value that indicates the background color for parts in the control.

Type | Description
Part as BackgroundPartEnum | A BackgroundPartEnum expression that indicates the part to be changed
Color | A Color expression that indicates the background color for a specified part. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
Use the Background property to specify a different visual appearance for parts of the control, such as tooltip, check or radio buttons.

The following screen shot shows the check-boxes, as they are shown by default:

The following screen shot shows the check-boxes, as once a new visual appearance is applied:

How can I change the visual appearance of the check-boxes to be displayed in the toolbar control (ebn)?

VBA (MS Access, Excell...)

With ToolBar1
    With .VisualAppearance
        .Add 1,"c:\exontrol\images\normal.ebn"
        .Add 2,"c:\exontrol\images\pushed.ebn"
    End With
    .Background(70) = &H1000000
    .Background(71) = &H2000000
    With .Items
        With .Add("",2)
            .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .VisualAppearance
        .Add 1,"c:\exontrol\images\normal.ebn"
        .Add 2,"c:\exontrol\images\pushed.ebn"
    End With
    .Background(exCheckBoxState0) = &H1000000
    .Background(exCheckBoxState1) = &H2000000
    With .Items
        With .Add("",2)
            .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .VisualAppearance
        .Add(1,"c:\exontrol\images\normal.ebn")
        .Add(2,"c:\exontrol\images\pushed.ebn")
    End With
    .set_Background32(exontrol.EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState0,&H1000000)
    .set_Background32(exontrol.EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState1,&H2000000)
    With .Items
        With .Add("",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .VisualAppearance
        .Add(1,"c:\exontrol\images\normal.ebn")
        .Add(2,"c:\exontrol\images\pushed.ebn")
    End With
    .set_Background(EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState0,16777216)
    .set_Background(EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState1,33554432)
    With .Items
        With .Add("",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            With .Items
                With .Add("Check 1")
                    .Check = True
                    .Checked = True
                End With
                .Add("Check 2").Check = True
            End With
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IAppearancePtr var_Appearance = spToolBar1->GetVisualAppearance();
    var_Appearance->Add(1,"c:\\exontrol\\images\\normal.ebn");
    var_Appearance->Add(2,"c:\\exontrol\\images\\pushed.ebn");
spToolBar1->PutBackground(EXTOOLBARLib::exCheckBoxState0,0x1000000);
spToolBar1->PutBackground(EXTOOLBARLib::exCheckBoxState1,0x2000000);
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",vtMissing,vtMissing);
                var_Item1->PutCheck(VARIANT_TRUE);
                var_Item1->PutChecked(VARIANT_TRUE);
            var_Items1->Add(L"Check 2",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IAppearancePtr var_Appearance = ToolBar1->VisualAppearance;
    var_Appearance->Add(1,TVariant("c:\\exontrol\\images\\normal.ebn"));
    var_Appearance->Add(2,TVariant("c:\\exontrol\\images\\pushed.ebn"));
ToolBar1->Background[Extoolbarlib_tlb::BackgroundPartEnum::exCheckBoxState0] = 0x1000000;
ToolBar1->Background[Extoolbarlib_tlb::BackgroundPartEnum::exCheckBoxState1] = 0x2000000;
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",TNoParam(),TNoParam());
                var_Item1->Check = true;
                var_Item1->Checked = true;
            var_Items1->Add(L"Check 2",TNoParam(),TNoParam())->Check = true;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Appearance var_Appearance = extoolbar1.VisualAppearance;
    var_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
    var_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn");
extoolbar1.set_Background32(exontrol.EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState0,0x1000000);
extoolbar1.set_Background32(exontrol.EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState1,0x2000000);
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
            var_Items1.Add("Check 2",null,null).Check = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Appearance = ToolBar1.VisualAppearance;
        var_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
        var_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn");
    ToolBar1.Background(70) = 16777216;
    ToolBar1.Background(71) = 33554432;
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("",2,null);
            var_Item.GroupPopup = 3;
            var var_Items1 = var_Item.Items;
                var var_Item1 = var_Items1.Add("Check 1",null,null);
                    var_Item1.Check = true;
                    var_Item1.Checked = true;
                var_Items1.Add("Check 2",null,null).Check = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .VisualAppearance
            .Add 1,"c:\exontrol\images\normal.ebn"
            .Add 2,"c:\exontrol\images\pushed.ebn"
        End With
        .Background(70) = &H1000000
        .Background(71) = &H2000000
        With .Items
            With .Add("",2)
                .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                With .Items
                    With .Add("Check 1")
                        .Check = True
                        .Checked = True
                    End With
                    .Add("Check 2").Check = True
                End With
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Appearance var_Appearance = axToolBar1.VisualAppearance;
    var_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
    var_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn");
axToolBar1.set_Background(EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState0,0x1000000);
axToolBar1.set_Background(EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState1,0x2000000);
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null);
                var_Item1.Check = true;
                var_Item1.Checked = true;
            var_Items1.Add("Check 2",null,null).Check = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Appearance,com_Item,com_Item1,com_Item2,com_Items,com_Items1;
    anytype var_Appearance,var_Item,var_Item1,var_Item2,var_Items,var_Items1;
    ;

    super();

    var_Appearance = extoolbar1.VisualAppearance(); com_Appearance = var_Appearance;
        com_Appearance.Add(1,"c:\\exontrol\\images\\normal.ebn");
        com_Appearance.Add(2,"c:\\exontrol\\images\\pushed.ebn");
    extoolbar1.Background(70/*exCheckBoxState0*/,0x1000000);
    extoolbar1.Background(71/*exCheckBoxState1*/,0x2000000);
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                var_Item1 = com_Items1.Add("Check 1"); com_Item1 = var_Item1;
                    com_Item1.Check(true);
                    com_Item1.Checked(true);
                var_Item2 = COM::createFromObject(com_Items1.Add("Check 2")); com_Item2 = var_Item2;
                com_Item2.Check(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with VisualAppearance do
    begin
        Add(1,'c:\exontrol\images\normal.ebn');
        Add(2,'c:\exontrol\images\pushed.ebn');
    end;
    set_Background(EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState0,$1000000);
    set_Background(EXTOOLBARLib.BackgroundPartEnum.exCheckBoxState1,$2000000);
    with Items do
    begin
        with Add('',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Nil,Nil) do
                begin
                    Check := True;
                    Checked := True;
                end;
                Add('Check 2',Nil,Nil).Check := True;
            end;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with VisualAppearance do
    begin
        Add(1,'c:\exontrol\images\normal.ebn');
        Add(2,'c:\exontrol\images\pushed.ebn');
    end;
    Background[EXTOOLBARLib_TLB.exCheckBoxState0] := $1000000;
    Background[EXTOOLBARLib_TLB.exCheckBoxState1] := $2000000;
    with Items do
    begin
        with Add('',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            with Items do
            begin
                with Add('Check 1',Null,Null) do
                begin
                    Check := True;
                    Checked := True;
                end;
                Add('Check 2',Null,Null).Check := True;
            end;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .VisualAppearance
        .Add(1,"c:\exontrol\images\normal.ebn")
        .Add(2,"c:\exontrol\images\pushed.ebn")
    endwith
    .Object.Background(70) = 0x1000000
    .Object.Background(71) = 0x2000000
    with .Items
        with .Add("",2)
            .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            with .Items
                with .Add("Check 1")
                    .Check = .T.
                    .Checked = .T.
                endwith
                .Add("Check 2").Check = .T.
            endwith
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Appearance,var_Item,var_Item1,var_Item2,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Appearance = oToolBar.VisualAppearance
    var_Appearance.Add(1,"c:\exontrol\images\normal.ebn")
    var_Appearance.Add(2,"c:\exontrol\images\pushed.ebn")
oToolBar.Template = [Background(70) = 0x1000000] // oToolBar.Background(70) = 0x1000000
oToolBar.Template = [Background(71) = 0x2000000] // oToolBar.Background(71) = 0x2000000
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
            // var_Items1.Add("Check 2").Check = true
            var_Item2 = var_Items1.Add("Check 2")
            with (oToolBar)
                TemplateDef = [Dim var_Item2]
                TemplateDef = var_Item2
                Template = [var_Item2.Check = true]
            endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Appearance as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Appearance = oToolBar.VisualAppearance
    var_Appearance.Add(1,"c:\exontrol\images\normal.ebn")
    var_Appearance.Add(2,"c:\exontrol\images\pushed.ebn")
oToolBar.Template = "Background(70) = 16777216" ' oToolBar.Background(70) = 16777216
oToolBar.Template = "Background(71) = 33554432" ' oToolBar.Background(71) = 33554432
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = .t.
                var_Item1.Checked = .t.
            ' var_Items1.Add("Check 2").Check = .t.
            var_Item2 = var_Items1.Add("Check 2")
            oToolBar.TemplateDef = "Dim var_Item2"
            oToolBar.TemplateDef = var_Item2
            oToolBar.Template = "var_Item2.Check = True"

oToolBar.Refresh()

Visual Objects

local var_Appearance as IAppearance
local var_Item,var_Item1 as IItem
local var_Items,var_Items1 as IItems

var_Appearance := oDCOCX_Exontrol1:VisualAppearance
    var_Appearance:Add(1,"c:\exontrol\images\normal.ebn")
    var_Appearance:Add(2,"c:\exontrol\images\pushed.ebn")
oDCOCX_Exontrol1:[Background,exCheckBoxState0] := 0x1000000
oDCOCX_Exontrol1:[Background,exCheckBoxState1] := 0x2000000
var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("",2,nil)
        var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup
        var_Items1 := var_Item:Items
            var_Item1 := var_Items1:Add("Check 1",nil,nil)
                var_Item1:Check := true
                var_Item1:Checked := true
            var_Items1:Add("Check 2",nil,nil):Check := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Appearance,var_Item,var_Item1,var_Items,var_Items1

oToolBar = ole_1.Object
var_Appearance = oToolBar.VisualAppearance
    var_Appearance.Add(1,"c:\exontrol\images\normal.ebn")
    var_Appearance.Add(2,"c:\exontrol\images\pushed.ebn")
oToolBar.Background(70,16777216 /*0x1000000*/)
oToolBar.Background(71,33554432 /*0x2000000*/)
var_Items = oToolBar.Items
    var_Item = var_Items.Add("",2)
        var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/
        var_Items1 = var_Item.Items
            var_Item1 = var_Items1.Add("Check 1")
                var_Item1.Check = true
                var_Item1.Checked = true
            var_Items1.Add("Check 2").Check = true
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voAppearance
    Get ComVisualAppearance to voAppearance
    Handle hoAppearance
    Get Create (RefClass(cComAppearance)) to hoAppearance
    Set pvComObject of hoAppearance to voAppearance
        Get ComAdd of hoAppearance 1 "c:\exontrol\images\normal.ebn" to Nothing
        Get ComAdd of hoAppearance 2 "c:\exontrol\images\pushed.ebn" to Nothing
    Send Destroy to hoAppearance
    Set ComBackground OLEexCheckBoxState0 to |CI$1000000
    Set ComBackground OLEexCheckBoxState1 to |CI$2000000
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Variant voItem1
                Get ComAdd of hoItems1 "Check 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComCheck of hoItem1 to True
                    Set ComChecked of hoItem1 to True
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Check 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComCheck of hoItem2 to True
                Send Destroy to hoItem2
            Send Destroy to hoItems1
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oAppearance
    LOCAL oItem,oItem1
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oAppearance := oToolBar:VisualAppearance()
            oAppearance:Add(1,"c:\exontrol\images\normal.ebn")
            oAppearance:Add(2,"c:\exontrol\images\pushed.ebn")
        oToolBar:SetProperty("Background",70/*exCheckBoxState0*/,0x1000000)
        oToolBar:SetProperty("Background",71/*exCheckBoxState1*/,0x2000000)
        oItems := oToolBar:Items()
            oItem := oItems:Add("",2)
                oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/
                oItems1 := oItem:Items()
                    oItem1 := oItems1:Add("Check 1")
                        oItem1:Check := .T.
                        oItem1:Checked := .T.
                    oItems1:Add("Check 2"):Check := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Cursor

property ToolBar.Cursor as Variant
Gets or sets the cursor that is displayed when the mouse pointer hovers the control.

Type | Description
Variant | A String expression that defines the cursor to be shown when the cursor hovers the menu. The Valid values are listed bellow. Also the Cursor property could point to a cursor file to be loaded and shown while the cursor hovers the toolbar.
By default, the Cursor property is "exDefault". Use the Cursor property to specify a different cursor when it hovers the menu control. Use the Cursor property of the Item object to specify a different cursor when it hovers the item only.

The supported values are:

  • "exDefault", Standard arrow
  • "exArrow", Standard arrow
  • "exCross", Crosshair
  • "exIBeam", I-beam
  • "exIcon", Reserved
  • "exSize", Reserved, use the "exSizeAll"
  • "exSizeNESW", Double-pointed arrow pointing northeast and southwest
  • "exSizeNS", Double-pointed arrow pointing north and south
  • "exSizeNWSE", Double-pointed arrow pointing northwest and southeast
  • "exSizeWE", Double-pointed arrow pointing west and east
  • "exUpArrow", Vertical arrow
  • "exHourglass", Hourglass
  • "exNoDrop", Slashed circle
  • "exArrowHourglass"
  • "exHelp", Arrow and question mark
  • "exSizeAll", Four-pointed arrow pointing north, south, east, and west
  • "exHand", Hand

Any other value indicates the path to a cursor file to be displayed when the pointer hovers the menu control.

Can I change the cursor where it hovers the item?

VBA (MS Access, Excell...)

With ToolBar1
    .Cursor = "exCross"
    With .Items
        .Add "Item 1"
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh
End With

VB6

With ToolBar1
    .Cursor = "exCross"
    With .Items
        .Add "Item 1"
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    .Cursor = "exCross"
    With .Items
        .Add("Item 1")
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    .Cursor = "exCross"
    With .Items
        .Add("Item 1")
        .Add("Item 2").Cursor = "exNoDrop"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutCursor("exCross");
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item 1",vtMissing,vtMissing);
    var_Items->Add(L"Item 2",vtMissing,vtMissing)->PutCursor("exNoDrop");
spToolBar1->Refresh();

C++ Builder

ToolBar1->set_Cursor(TVariant("exCross"));
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item 1",TNoParam(),TNoParam());
    var_Items->Add(L"Item 2",TNoParam(),TNoParam())->set_Cursor(TVariant("exNoDrop"));
ToolBar1->Refresh();

C#

extoolbar1.Cursor = "exCross";
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null).Cursor = "exNoDrop";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.Cursor = "exCross";
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item 1",null,null);
        var_Items.Add("Item 2",null,null).Cursor = "exNoDrop";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .Cursor = "exCross"
        With .Items
            .Add "Item 1"
            .Add("Item 2").Cursor = "exNoDrop"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axToolBar1.Cursor = "exCross";
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null).Cursor = "exNoDrop";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    extoolbar1.Cursor("exCross");
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("Item 1");
        var_Item = COM::createFromObject(com_Items.Add("Item 2")); com_Item = var_Item;
        com_Item.Cursor("exNoDrop");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    Cursor := 'exCross';
    with Items do
    begin
        Add('Item 1',Nil,Nil);
        Add('Item 2',Nil,Nil).Cursor := 'exNoDrop';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    Cursor := 'exCross';
    with Items do
    begin
        Add('Item 1',Null,Null);
        Add('Item 2',Null,Null).Cursor := 'exNoDrop';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    .Cursor = "exCross"
    with .Items
        .Add("Item 1")
        .Add("Item 2").Cursor = "exNoDrop"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.Cursor = "exCross"
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    // var_Items.Add("Item 2").Cursor = "exNoDrop"
    var_Item = var_Items.Add("Item 2")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Cursor = "exNoDrop"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.Cursor = "exCross"
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    ' var_Items.Add("Item 2").Cursor = "exNoDrop"
    var_Item = var_Items.Add("Item 2")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Cursor = \"exNoDrop\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

oDCOCX_Exontrol1:Cursor := "exCross"
var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item 1",nil,nil)
    var_Items:Add("Item 2",nil,nil):Cursor := "exNoDrop"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
oToolBar.Cursor = "exCross"
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2").Cursor = "exNoDrop"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Set ComCursor to "exCross"
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "Item 1" Nothing Nothing to Nothing
        Variant voItem
        Get ComAdd of hoItems "Item 2" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComCursor of hoItem to "exNoDrop"
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:Cursor := "exCross"
        oItems := oToolBar:Items()
            oItems:Add("Item 1")
            oItems:Add("Item 2"):Cursor := "exNoDrop"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Debug

property ToolBar.Debug as Boolean
Retrieves or sets a value that indicating whether the item's identifier is visible.

Type | Description
Boolean | A Boolean expression that specifies whether the identifiers of the items
By default, the Debug property is False. Use the Debug property to display the identifiers for all visible items, for debugging purposes. The First number in the [] parenthesis indicates the item's ID property.


property Enabled

property ToolBar.Enabled as Boolean
Enables or disables the control.

Type | Description
Boolean | A Boolean expression that specifies whether the control is enabled or disabled.
By default, the Enabled property is True. Use the Enabled property to disable the control. When the control is disabled the inside elements look as grayed. Use the Enabled property of the Item object to disable a specific item. Use the Locked property to disabled the control without changing the visual appearance of the inside elements.

How can I enable or disable an item?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item").Enabled = False
        .Add("").ToString = "Item[dis]"
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutEnabled(VARIANT_FALSE);
    var_Items->Add(L"",vtMissing,vtMissing)->PutToString(L"Item[dis]");
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Enabled = false;
    var_Items->Add(L"",TNoParam(),TNoParam())->ToString = L"Item[dis]";
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Enabled = false;
    var_Items.Add("",null,null).ToString = "Item[dis]";
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Enabled = false;
        var_Items.Add("",null,null).ToString = "Item[dis]";
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Enabled = False
            .Add("").ToString = "Item[dis]"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Enabled = false;
    var_Items.Add("",null,null).ToString = "Item[dis]";
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Enabled(false);
        var_Item = COM::createFromObject(com_Items.Add("")); com_Item = var_Item;
        com_Item.ToString("Item[dis]");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Enabled := False;
        Add('',Nil,Nil).ToString := 'Item[dis]';
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Enabled := False;
        Add('',Null,Null).ToString := 'Item[dis]';
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item").Enabled = .F.
        .Add("").ToString = "Item[dis]"
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Enabled = false
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Enabled = false]
    endwith
    // var_Items.Add("").ToString = "Item[dis]"
    var_Item1 = var_Items.Add("")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.ToString = "Item[dis]"]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Enabled = .f.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Enabled = False"

    ' var_Items.Add("").ToString = "Item[dis]"
    var_Item1 = var_Items.Add("")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.ToString = \"Item[dis]\""

oToolBar.Refresh()

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Enabled := false
    var_Items:Add("",nil,nil):ToString := "Item[dis]"
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Enabled = false
    var_Items.Add("").ToString = "Item[dis]"
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComEnabled of hoItem to False
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComToString of hoItem1 to "Item[dis]"
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item"):Enabled := .F.
            oItems:Add(""):ToString := "Item[dis]"
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property EventParam

property ToolBar.EventParam(Parameter as Long) as Variant
Retrieves or sets a value that indicates the current's event parameter.

Type | Description
Parameter as Long | A long expression that indicates the index of the parameter being requested ie 0 means the first parameter, 1 means the second, and so on. If -1 is used the EventParam property retrieves the number of parameters. Accessing an not-existing parameter produces an OLE error, such as invalid pointer ( E_POINTER )
Variant | A VARIANT expression that specifies the parameter's value.
The EventParam method is provided to allow changing the event's parameters passed by reference, even if your environment does not support changing it ( uniPaas 1.5 (formerly known as eDeveloper), DBase, and so on ). For instance, Unipaas event-handling logic cannot update ActiveX control variables by updating the received arguments. The EventParam(0) retrieves the value of the first parameter of the event, while the EventParam(1) = 0, changes the value of the second parameter to 0 ( the operation is successfully, only if the parameter is passed by reference ). The EventParam(-1) retrieves the number of the parameters of the current event.

Let's take the event "event KeyDown (KeyCode as Integer, ByVal Shift as Integer)", where the KeyCode parameter is passed by reference. For instance, put the KeyCode parameter on 0, and the arrow keys are disabled while the control has the focus.

In most languages you will type something like:

Private Sub Control1_KeyDown(KeyCode As Integer, Shift As Integer)
    KeyCode = 0
End Sub

In case your environment does not support events with parameters by reference, you can use a code like follows:

Private Sub Control1_KeyDown(KeyCode As Integer, Shift As Integer)
    Control1.EventParam(0) = 0
End Sub

In other words, the EventParam property provides the parameters of the current event for reading or writing access, even if your environment does not allow changing parameters by reference.

Calling the EventParam property outside of an event produces an OLE error, such as pointer invalid, as its scope was designed to be used only during events.


method ExecuteTemplate

method ToolBar.ExecuteTemplate (Template as String)
Executes a template and returns the result.

Type | Description
Template as String | A Template string being executed
Return | Description
Variant | A String expression that indicates the result after executing the Template.
Use the ExecuteTemplate property to returns the result of executing a template file. Use the Template property to execute a template without returning any result. Use the ExecuteTemplate property to execute code by passing instructions as a string ( template string ).

Most of our UI components provide a Template page that's accessible in design mode. No matter what programming language you are using, you can have a quick view of the component's features using the WYSWYG Template editor.

  • Place the control to your form or dialog.
  • Locate the Properties item, in the control's context menu, in design mode. If your environment doesn't provide a Properties item in the control's context menu, please try to locate in the Properties browser.
  • Click it, and locate the Template page.
  • Click the Help button. In the left side, you will see the component, in the right side, you will see a x-script code that calls methods and properties of the control.

The control's Template page helps user to initialize the control's look and feel in design mode, using the x-script language that's easy and powerful. The Template page displays the control on the left side of the page. On the right side of the Template page, a simple editor is displayed where user writes the initialization code. The control's look and feel is automatically updated as soon as the user types new instructions. The Template script is saved to the container persistence ( when Apply button is pressed ), and it is executed when the control is initialized at runtime. Any component that provides a WYSWYG Template page, provides a Template property. The Template property executes code from a string ( template string ).

The Template script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline ) characters.

An instruction can be one of the following:

  • Dim list of variables Declares the variables. Multiple variables are separated by commas. ( Sample: Dim h, h1, h2 )
  • variable = property( list of arguments ) Assigns the result of the property to a variable. The "variable" is the name of a declared variable. The "property" is the property name of the object in the context. The "list or arguments" may include variables or values separated by commas. ( Sample: h = InsertItem(0,"New Child") )
  • property( list of arguments ) = value Changes the property. The value can be a variable, a string, a number, a boolean value or a RGB value.
  • method( list of arguments ) Invokes the method. The "list or arguments" may include variables or values separated by commas.
  • { Beginning the object's context. The properties or methods called between { and } are related to the last object returned by the property prior to { declaration.
  • } Ending the object's context
  • object. property( list of arguments ).property( list of arguments ).... The .(dot) character splits the object from its property. For instance, the Columns.Add("Column1").HeaderBackColor = RGB(255,0,0), adds a new column and changes the column's header back color.

The Template supports the following general functions:

  • RGB(R,G,B) property retrieves an RGB value, where the R, G, B are byte values that indicates the R G B values for the color being specified. For instance, the following code changes the control's background color to red: BackColor = RGB(255,0,0)
  • CreateObject(progID) property creates and retrieves a single uninitialized object of the class associated with a specified program identifier.


property Font

property ToolBar.Font as IFontDisp
Retrieves or sets the control's font.

Type | Description
IFontDisp | A Font object to be used to shown the control items.
Use the Font property to specify a different font to show the items in the toolbar. The Font's height controls the height of the items in the control. You can use the <font> HTML tag to specify a different font for a specified item in the Caption property. The ForeColor property of the control specifies the foreground color of items in the control.


property ForeColor

property ToolBar.ForeColor as Color
Specifies the control's foreground color.

Type | Description
Color | A Color expression that specifies the control's foreground color.
The ForeColor property specifies the control's foreground color. The BackColor property specifies the control's background color. The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The SelForeColor property specifies the foreground color of the item being selected / highlighted. The Background property specifies the visual appearance for different parts of the control. The Appearance property specifies the menu's frame appearance. You can use the <fgcolor> HTML tag to specify a different foreground colot for a specified item in the Caption property. The ForeColor property of the Item object specifies a different foreground color for the entire item.


property Get

property ToolBar.Get (Criteria as MenuItemTypeEnum) as Variant
Retrieves an array of Item objects that meet the criteria.

Type | Description
Criteria as MenuItemTypeEnum | A MenuItemTypeEnum expression that type of items to be retrieved.
Variant | A Safe-Array of Item objects being returned.
The Get method can be used to get a collection / safe array of Item objects with a specified characteristics. For instance, you can collect the items of Edit type, or items that displays an icon using the Image property. The GetChecked property gets a collection of checked items. The GetUnchecked property gets a collection of checked items. The GetRadio method gets a safe array with the radio-items being checked within a radio group. For instance, the GetChecked property is equivalent with the Get(exCheckBoxMenuItem + exCheckedMenuItem), or in other words all items with the Check and Checked properties on True. The result of the Get method indicates a Safe-Array of Item objects, which means that you can use the for each statement to enumerate the elements in the collection. The ItemType property is a read-only property that gets the type of the item.


property GetChecked

property ToolBar.GetChecked as Variant
Retrieves an array of Item objects, that displays a check box which is checked.

Type | Description
Variant | A Safe-Array of Item objects that indicates the checked items in the control. The collection does include only items with the Check property set on True.
The GetChecked property gets a collection of checked items. The GetUnchecked property gets a collection of checked items. The GetRadio method gets a safe array with the radio-items being checked within a radio group. The Check property indicates whether the current item displays a check box. The Checked property specifies whether the item is checked or un-checked. The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked inside.

The following VB sample displays the caption of the items being checked in the control:

Dim c As Variant
For Each c In toolbar.GetChecked
    Debug.Print vbTab & c.Caption
Next

The following VB/NET sample displays the caption of the items being checked in the control:

Dim c As Object
For Each c In Extoolbar1.GetChecked
    Debug.Print(vbTab & c.Caption)
Next

The following C# sample displays the caption of the items being checked in the control:

foreach (exontrol.EXTOOLBARLib.Item i in extoolbar1.GetChecked)
    System.Diagnostics.Debug.Print("\t" + i.Caption);


property GetRadio

property ToolBar.GetRadio ([RadioGroup as Variant]) as Variant
Retrieves an array of Item objects of radio type in the same group, that are checked.

Type | Description
RadioGroup as Variant | A Long expression that specifies the radio-group being queried, or zero if you were not used any RadioGroup call.
Variant | A Safe-Array of Item objects that indicates the radio-checked items in the control. The collection does include only items with the Radio property set on True. The collection may contains zero or one element indicating the radio-item being checked in the specified radio group.
The GetRadio method gets a safe array with the radio-items being checked within a radio group. The GetChecked property gets a collection of checked items. The GetUnchecked property gets a collection of checked items. The Check property indicates whether the current item displays a check box. The Checked property specifies whether the item is checked or un-checked. The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked inside.

The following VB sample displays the caption of radio-item being checked ( single radio-group, or the RadioGroup property has not been used to create ore groups ) :

Dim c As Variant
For Each c In toolbar.GetRadio
    Debug.Print vbTab & c.Caption
Next

The following VB sample displays the caption of radio-item being checked in the radio-group with the identifier 100:

Dim c As Variant
For Each c In toolbar.GetRadio(100)
    Debug.Print vbTab & c.Caption
Next

The following VB/NET sample displays the caption of radio-item being checked ( single radio-group, or the RadioGroup property has not been used to create ore groups ) :

Dim c As Variant
For Each c In toolbar.GetRadio
    Debug.Print vbTab & c.Caption
Next

The following VB/NET sample displays the caption of radio-item being checked in the radio-group with the identifier 100:

Dim c As Variant
For Each c In toolbar.get_GetRadio(100)
    Debug.Print vbTab & c.Caption
Next

The following C# sample displays the caption of radio-item being checked ( single radio-group, or the RadioGroup property has not been used to create ore groups ) :

foreach (exontrol.EXTOOLBARLib.Item i in extoolbar1.GetRadio)
    System.Diagnostics.Debug.Print("\t" + i.Caption);

The following C# sample displays the caption of radio-item being checked in the radio-group with the identifier 100:

foreach (exontrol.EXTOOLBARLib.Item i in extoolbar1.get_GetRadio(100))
    System.Diagnostics.Debug.Print("\t" + i.Caption);


property GetUnchecked

property ToolBar.GetUnchecked as Variant
Retrieves an array of Item objects, that displays a check box which is unchecked.

Type | Description
Variant | A Safe-Array of Item objects that indicates the checked items in the control. The collection does include only items with the Check property set on True.
The GetUnchecked property gets a collection of checked items. The GetChecked property gets a collection of checked items. The GetRadio method gets a safe array with the radio-items being checked within a radio group. The Check property indicates whether the current item displays a check box. The Checked property specifies whether the item is checked or un-checked. The Radio property specifies whether the item displays a radio-button. The RadioGroup property specifies a group of radio-buttons. A radio group allows a single radio-item to be checked inside.

The following VB sample displays the caption of the items being un-checked in the control:

Dim c As Variant
For Each c In toolbar.GetUnchecked
    Debug.Print vbTab & c.Caption
Next

The following VB/NET sample displays the caption of the items being un-checked in the control:

Dim c As Object
For Each c In Extoolbar1.GetUnchecked
    Debug.Print(vbTab & c.Caption)
Next

The following C# sample displays the caption of the items being un-checked in the control:

foreach (exontrol.EXTOOLBARLib.Item i in extoolbar1.GetUnchecked)
    System.Diagnostics.Debug.Print("\t" + i.Caption);


property HTMLPicture

property ToolBar.HTMLPicture(Key as String) as Variant
Adds or replaces a picture in HTML captions.

Type | Description
Key as String | A String expression that indicates the key of the picture being added or replaced. If the Key property is Empty string, the entire collection of pictures is cleared.
Variant The HTMLPicture specifies the picture being associated to a key. It can be one of the followings:
  • a string expression that indicates the path to the picture file, being loaded.
  • a string expression that indicates the base64 encoded string that holds a picture object, Use the eximages tool to save your picture as base64 encoded format.
  • A Picture object that indicates the picture being added or replaced. ( A Picture object implements IPicture interface ),

If empty, the picture being associated to a key is removed. If the key already exists the new picture is replaced. If the key is not empty, and it doesn't not exist a new picture is added

The HTMLPicture property handles a collection of custom size picture being displayed in the HTML captions, using the <img> tags. By default, the HTMLPicture collection is empty. Use the HTMLPicture property to add new pictures to be used in HTML captions. For instance, the HTMLPicture("pic1") = "c:\winnt\zapotec.bmp", loads the zapotec picture and associates the pic1 key to it. Any "<img>pic1</img>" sequence in HTML captions, displays the pic1 picture. On return, the HTMLPicture property retrieves a Picture object ( this implements the IPictureDisp interface ). The <img> tag can be used in the Caption property of the Item object. Use the HTMLImage property to assign a BMP, JPG, GIF or PNG file to left side of the caption, the same way as you will do with the Image property. Use the PopupFlatImageWidth property to specify the width of the column that displays icons/images/check or radio buttons.


property hWnd

property ToolBar.hWnd as Long
Retrieves the control's window handle.

Type | Description
Long | A long expression that indicates the control's window handle.
The Microsoft Windows operating environment identifies each form and control in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument.


method Images

method ToolBar.Images (Handle as Variant)

Sets the control's image list at runtime.

Type Description
Handle as Variant The Handle parameter can be:
  • A string expression that specifies the ICO file to add. The ICO file format is an image file format for computer icons in Microsoft Windows. ICO files contain one or more small images at multiple sizes and color depths, such that they may be scaled appropriately. For instance, Images("c:\temp\copy.ico") method adds the sync.ico file to the control's Images collection (string, loads the icon using its path)
  • A string expression that indicates the BASE64 encoded string that holds the icons list. Use the Exontrol's ExImages tool to save/load your icons as BASE64 encoded format. In this case the string may begin with "gBJJ..." (string, loads icons using base64 encoded string)
  • A reference to a Microsoft ImageList control (mscomctl.ocx, MSComctlLib.ImageList type) that holds the icons to add (object, loads icons from a Microsoft ImageList control)
  • A reference to a Picture (IPictureDisp implementation) that holds the icon to add. For instance, the VB's LoadPicture (Function LoadPicture([FileName], [Size], [ColorDepth], [X], [Y]) As IPictureDisp) or LoadResPicture (Function LoadResPicture(id, restype As Integer) As IPictureDisp) returns a picture object (object, loads icon from a Picture object)
  • A long expression that identifies a handle to an Image List Control ( the Handle should be of HIMAGELIST type ). On 64-bit platforms, the Handle parameter must be a Variant of LongLong / LONG_PTR data type ( signed 64-bit (8-byte) integers ), saved under llVal field, as VT_I8 type. The LONGLONG / LONG_PTR is __int64, a 64-bit integer. For instance, in C++ you can use as Images( COleVariant( (LONG_PTR)hImageList) ) or Images( COleVariant( (LONGLONG)hImageList) ), where hImageList is of HIMAGELIST type. The GetSafeHandle() method of the CImageList gets the HIMAGELIST handle (long, loads icon from HIMAGELIST type)

The user can add images at design time, by drag and drop files to combo's image holder. Use the ReplaceIcon method to add, remove or clear icons in the control's images collection. The <img> tag can be used in the Caption property of the Item object. Also, the Image property assign an icon to the specified item.


property ImageSize

property ToolBar.ImageSize as Long
Retrieves or sets the size of icons the control displays.

Type | Description
Long | A long expression that defines the size of icons the control displays
By default, the ImageSize property is 16 (pixels). The ImageSize property specifies the size of icons being loaded using the Images method. The control's Images collection is cleared if the ImageSize property is changed, so it is recommended to set the ImageSize property before calling the Images method. The ImageSize property defines the size (width/height) of the icons within the control's Images collection. For instance, if the ICO file to load includes different types the one closest with the size specified by ImageSize property is loaded by Images method. The ImageSize property does NOT change the height for the control's font.


property Item

property ToolBar.Item (ID as Variant) as Item
Returns a specific Item object giving its identifier or caption.

Type | Description
ID as Variant | A Long expression that specifies the identifier of the item being requested or a String expression that specifies the caption of the item being requested.
Item | An Item object with associated identifier.
The Item property searches recursively the item with giving identifier/caption. The ID property of the Item object specifies the identifier of the item. The Caption property of the Item object specifies the caption of the item. The Item property gets the first Item object being found, if multiple objects with the same identifier are found, or Nothing, if no item with associated identifier is found. The Item property of the Items compared with the Item property of the eXToolBar is that the first look in the specified Items collection, while the second is looking for all Items in the menu object.


property ItemFromPoint

property ToolBar.ItemFromPoint (X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS) as Item
Retrieves the item from the cursor.

Type | Description
X as OLE_XPOS_PIXELS | A long expression that specifies the x-position to request item from
Y as OLE_YPOS_PIXELS | A long expression that specifies the y-position to request item from
Item | Returns the Item object from the cursor.
The ItemFromPoint(-1.-1) property determines the item from current cursor.


property Items

property ToolBar.Items as Items
Retrieves the control's Items collection.

Type | Description
Items | An Items object that holds a collection of Item objects.
The Items property gives access to the control's Items collection, so you can add, remove or update the items being shown in the toolbar control. The Add method adds a new item to the Items collection. The ToString property loads or saves the control items from a string. The Remove method removes a specified item. The Item property accesses an Item object giving its identifier or caption.

Is it possible to expand an item when it is clicked (tree,group,vertical)?

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = 259 ' GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical Or exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        With .Add("Expand",2)
            .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical Or EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup
            .Check = True
            .ShowPopupOnChecked = True
            With .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = True
                .Add("Radio 2").Radio = True
                With .Add("Radio 3")
                    .Radio = True
                    .Checked = True
                End With
            End With
            .Checked = True
        End With
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Expand",long(2),vtMissing);
        var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exGroupPopupVertical | EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup));
        var_Item->PutCheck(VARIANT_TRUE);
        var_Item->PutShowPopupOnChecked(VARIANT_TRUE);
        EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems();
            var_Items1->PutPadding(L"22,0,0,0");
            var_Items1->Add(L"Radio 1",vtMissing,vtMissing)->PutRadio(VARIANT_TRUE);
            var_Items1->Add(L"Radio 2",vtMissing,vtMissing)->PutRadio(VARIANT_TRUE);
            EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Radio 3",vtMissing,vtMissing);
                var_Item1->PutRadio(VARIANT_TRUE);
                var_Item1->PutChecked(VARIANT_TRUE);
        var_Item->PutChecked(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Expand",TVariant(2),TNoParam());
        var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exGroupPopupVertical | Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup;
        var_Item->Check = true;
        var_Item->ShowPopupOnChecked = true;
        Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items;
            var_Items1->Padding = L"22,0,0,0";
            var_Items1->Add(L"Radio 1",TNoParam(),TNoParam())->Radio = true;
            var_Items1->Add(L"Radio 2",TNoParam(),TNoParam())->Radio = true;
            Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Radio 3",TNoParam(),TNoParam());
                var_Item1->Radio = true;
                var_Item1->Checked = true;
        var_Item->Checked = true;
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Expand",2,null);
        var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical | exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        var_Item.Check = true;
        var_Item.ShowPopupOnChecked = true;
        exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.Padding = "22,0,0,0";
            var_Items1.Add("Radio 1",null,null).Radio = true;
            var_Items1.Add("Radio 2",null,null).Radio = true;
            exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 3",null,null);
                var_Item1.Radio = true;
                var_Item1.Checked = true;
        var_Item.Checked = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Expand",2,null);
            var_Item.GroupPopup = 259;
            var_Item.Check = true;
            var_Item.ShowPopupOnChecked = true;
            var var_Items1 = var_Item.Items;
                var_Items1.Padding = "22,0,0,0";
                var_Items1.Add("Radio 1",null,null).Radio = true;
                var_Items1.Add("Radio 2",null,null).Radio = true;
                var var_Item1 = var_Items1.Add("Radio 3",null,null);
                    var_Item1.Radio = true;
                    var_Item1.Checked = true;
            var_Item.Checked = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Expand",2)
                .GroupPopup = 259 ' GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
                .Check = True
                .ShowPopupOnChecked = True
                With .Items
                    .Padding = "22,0,0,0"
                    .Add("Radio 1").Radio = True
                    .Add("Radio 2").Radio = True
                    With .Add("Radio 3")
                        .Radio = True
                        .Checked = True
                    End With
                End With
                .Checked = True
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Expand",2,null);
        var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical | EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup;
        var_Item.Check = true;
        var_Item.ShowPopupOnChecked = true;
        EXTOOLBARLib.Items var_Items1 = var_Item.Items;
            var_Items1.Padding = "22,0,0,0";
            var_Items1.Add("Radio 1",null,null).Radio = true;
            var_Items1.Add("Radio 2",null,null).Radio = true;
            EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 3",null,null);
                var_Item1.Radio = true;
                var_Item1.Checked = true;
        var_Item.Checked = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Item,com_Item1,com_Items,com_Items1;
    anytype var_Item,var_Item1,var_Items,var_Items1;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Expand",COMVariant::createFromInt(2)); com_Item = var_Item;
            com_Item.GroupPopup(259/*exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup*/);
            com_Item.Check(true);
            com_Item.ShowPopupOnChecked(true);
            var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
                com_Items1.Padding("22,0,0,0");
                var_Item1 = COM::createFromObject(com_Items1.Add("Radio 1")); com_Item1 = var_Item1;
                com_Item1.Radio(true);
                var_Item1 = COM::createFromObject(com_Items1.Add("Radio 2")); com_Item1 = var_Item1;
                com_Item1.Radio(true);
                var_Item1 = com_Items1.Add("Radio 3"); com_Item1 = var_Item1;
                    com_Item1.Radio(true);
                    com_Item1.Checked(true);
            com_Item.Checked(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Expand',TObject(2),Nil) do
        begin
            GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopupVertical) Or Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup);
            Check := True;
            ShowPopupOnChecked := True;
            with Items do
            begin
                Padding := '22,0,0,0';
                Add('Radio 1',Nil,Nil).Radio := True;
                Add('Radio 2',Nil,Nil).Radio := True;
                with Add('Radio 3',Nil,Nil) do
                begin
                    Radio := True;
                    Checked := True;
                end;
            end;
            Checked := True;
        end;
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Expand',OleVariant(2),Null) do
        begin
            GroupPopup := Integer(EXTOOLBARLib_TLB.exGroupPopupVertical) Or Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup);
            Check := True;
            ShowPopupOnChecked := True;
            with Items do
            begin
                Padding := '22,0,0,0';
                Add('Radio 1',Null,Null).Radio := True;
                Add('Radio 2',Null,Null).Radio := True;
                with Add('Radio 3',Null,Null) do
                begin
                    Radio := True;
                    Checked := True;
                end;
            end;
            Checked := True;
        end;
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items
        with .Add("Expand",2)
            .GroupPopup = 259 && GroupPopupEnum.exGroupPopupVertical Or GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup
            .Check = .T.
            .ShowPopupOnChecked = .T.
            with .Items
                .Padding = "22,0,0,0"
                .Add("Radio 1").Radio = .T.
                .Add("Radio 2").Radio = .T.
                with .Add("Radio 3")
                    .Radio = .T.
                    .Checked = .T.
                endwith
            endwith
            .Checked = .T.
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Expand",2)
        var_Item.GroupPopup = 259 /*exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup*/
        var_Item.Check = true
        var_Item.ShowPopupOnChecked = true
        var_Items1 = var_Item.Items
            var_Items1.Padding = "22,0,0,0"
            // var_Items1.Add("Radio 1").Radio = true
            var_Item1 = var_Items1.Add("Radio 1")
            with (oToolBar)
                TemplateDef = [Dim var_Item1]
                TemplateDef = var_Item1
                Template = [var_Item1.Radio = true]
            endwith
            // var_Items1.Add("Radio 2").Radio = true
            var_Item2 = var_Items1.Add("Radio 2")
            with (oToolBar)
                TemplateDef = [Dim var_Item2]
                TemplateDef = var_Item2
                Template = [var_Item2.Radio = true]
            endwith
            var_Item3 = var_Items1.Add("Radio 3")
                var_Item3.Radio = true
                var_Item3.Checked = true
        var_Item.Checked = true
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Item2 as P
Dim var_Item3 as P
Dim var_Items as P
Dim var_Items1 as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Expand",2)
        var_Item.GroupPopup = 259 'exGroupPopupVertical + exNoGroupPopupFrame + exGroupPopup
        var_Item.Check = .t.
        var_Item.ShowPopupOnChecked = .t.
        var_Items1 = var_Item.Items
            var_Items1.Padding = "22,0,0,0"
            ' var_Items1.Add("Radio 1").Radio = .t.
            var_Item1 = var_Items1.Add("Radio 1")
            oToolBar.TemplateDef = "Dim var_Item1"
            oToolBar.TemplateDef = var_Item1
            oToolBar.Template = "var_Item1.Radio = True"

            ' var_Items1.Add("Radio 2").Radio = .t.
            var_Item2 = var_Items1.Add("Radio 2")
            oToolBar.TemplateDef = "Dim var_Item2"
            oToolBar.TemplateDef = var_Item2
            oToolBar.Template = "var_Item2.Radio = True"

            var_Item3 = var_Items1.Add("Radio 3")
                var_Item3.Radio = .t.
                var_Item3.Checked = .t.
        var_Item.Checked = .t.
oToolBar.Refresh()

Visual Objects

local var_Item,var_Item1 as IItem
local var_Items,var_Items1 as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Expand",2,nil)
        var_Item:GroupPopup := exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup
        var_Item:Check := true
        var_Item:ShowPopupOnChecked := true
        var_Items1 := var_Item:Items
            var_Items1:Padding := "22,0,0,0"
            var_Items1:Add("Radio 1",nil,nil):Radio := true
            var_Items1:Add("Radio 2",nil,nil):Radio := true
            var_Item1 := var_Items1:Add("Radio 3",nil,nil)
                var_Item1:Radio := true
                var_Item1:Checked := true
        var_Item:Checked := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Item,var_Item1,var_Items,var_Items1

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Expand",2)
        var_Item.GroupPopup = 259 /*exGroupPopupVertical | exNoGroupPopupFrame | exGroupPopup*/
        var_Item.Check = true
        var_Item.ShowPopupOnChecked = true
        var_Items1 = var_Item.Items
            var_Items1.Padding = "22,0,0,0"
            var_Items1.Add("Radio 1").Radio = true
            var_Items1.Add("Radio 2").Radio = true
            var_Item1 = var_Items1.Add("Radio 3")
                var_Item1.Radio = true
                var_Item1.Checked = true
        var_Item.Checked = true
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Expand" 2 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComGroupPopup of hoItem to (OLEexGroupPopupVertical + OLEexNoGroupPopupFrame + OLEexGroupPopup)
            Set ComCheck of hoItem to True
            Set ComShowPopupOnChecked of hoItem to True
            Variant voItems1
            Get ComItems of hoItem to voItems1
            Handle hoItems1
            Get Create (RefClass(cComItems)) to hoItems1
            Set pvComObject of hoItems1 to voItems1
                Set ComPadding of hoItems1 to "22,0,0,0"
                Variant voItem1
                Get ComAdd of hoItems1 "Radio 1" Nothing Nothing to voItem1
                Handle hoItem1
                Get Create (RefClass(cComItem)) to hoItem1
                Set pvComObject of hoItem1 to voItem1
                    Set ComRadio of hoItem1 to True
                Send Destroy to hoItem1
                Variant voItem2
                Get ComAdd of hoItems1 "Radio 2" Nothing Nothing to voItem2
                Handle hoItem2
                Get Create (RefClass(cComItem)) to hoItem2
                Set pvComObject of hoItem2 to voItem2
                    Set ComRadio of hoItem2 to True
                Send Destroy to hoItem2
                Variant voItem3
                Get ComAdd of hoItems1 "Radio 3" Nothing Nothing to voItem3
                Handle hoItem3
                Get Create (RefClass(cComItem)) to hoItem3
                Set pvComObject of hoItem3 to voItem3
                    Set ComRadio of hoItem3 to True
                    Set ComChecked of hoItem3 to True
                Send Destroy to hoItem3
            Send Destroy to hoItems1
            Set ComChecked of hoItem to True
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem,oItem1
    LOCAL oItems,oItems1
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItem := oItems:Add("Expand",2)
                oItem:GroupPopup := 259/*exGroupPopupVertical+exNoGroupPopupFrame+exGroupPopup*/
                oItem:Check := .T.
                oItem:ShowPopupOnChecked := .T.
                oItems1 := oItem:Items()
                    oItems1:Padding := "22,0,0,0"
                    oItems1:Add("Radio 1"):Radio := .T.
                    oItems1:Add("Radio 2"):Radio := .T.
                    oItem1 := oItems1:Add("Radio 3")
                        oItem1:Radio := .T.
                        oItem1:Checked := .T.
                oItem:Checked := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property LocalAppearance

property ToolBar.LocalAppearance as ToolBarAppearanceEnum
Retrieves or sets the local popup's appearance.

Type | Description
ToolBarAppearanceEnum | A ToolBarAppearanceEnum expression that specifies the local's frame appearance, or a color expression whose last 7 bits in the high significant byte of the value indicates the index of the skin in the Appearance collection, being displayed as control's borders. For instance, if the Appearance = 0x1000000, indicates that the first skin object in the Appearance collection defines the control's border. The Client object in the skin, defines the client area of the control. The list/hierarchy, scrollbars are always shown in the control's client area. The skin may contain transparent objects, and so you can define round corners. The normal.ebn file contains such of objects. Use the eXButton's Skin builder to view or change this file
By default, the LocalAppearance property is -1. The visual appearance of the local popup is specified by the control's Appearance property, while the LocalAppearance property is -1. The ShowLocalPopup property specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus. The PopupAppearance specifies a different visual appearance for the current submenu. When using EBN appearance, using the PopupAppearance, LocalAppearance or Appearance, the distance between margins/borders and items client area is indicated by the client object of the skin/ebn object.

The following screen shot shows the sub-menu with different appearances:

(single appearance)

(shadow appearance)

(ebn appearance)

(ebn appearance)


property Locked

property ToolBar.Locked as Boolean
Locks or unlocks the control.

Type | Description
Boolean | A Boolean expression that specifies whether the control is locked or unlocked.
By default, the Locked property is False. Use the Locked property to lock the control. When the control is locked the inside elements look normal. Use the Enabled property of the Item object to disable a specific item. Use the Enabled property to enable or disable the control.

How can I lock the control, so no events occur, but no shown in gray as Enabled do?

VBA (MS Access, Excell...)

' SelectItem event - Occurs when the user selects the item.
Private Sub ToolBar1_SelectItem(ByVal Itm As Object)
    With ToolBar1
        Debug.Print( "SelectItem should not be fired while locked" )
    End With
End Sub

With ToolBar1
    .Locked = True
    With .Items
        .Add("Disabled").Enabled = False
        .Add "Item 2"
        .Add "Item 3"
    End With
    .Refresh
End With

VB6

' SelectItem event - Occurs when the user selects the item.
Private Sub ToolBar1_SelectItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
    With ToolBar1
        Debug.Print( "SelectItem should not be fired while locked" )
    End With
End Sub

With ToolBar1
    .Locked = True
    With .Items
        .Add("Disabled").Enabled = False
        .Add "Item 2"
        .Add "Item 3"
    End With
    .Refresh
End With

VB.NET

' SelectItem event - Occurs when the user selects the item.
Private Sub Extoolbar1_SelectItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.SelectItem
    With Extoolbar1
        Debug.Print( "SelectItem should not be fired while locked" )
    End With
End Sub

With Extoolbar1
    .Locked = True
    With .Items
        .Add("Disabled").Enabled = False
        .Add("Item 2")
        .Add("Item 3")
    End With
    .Refresh()
End With

VB.NET for /COM

' SelectItem event - Occurs when the user selects the item.
Private Sub AxToolBar1_SelectItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent) Handles AxToolBar1.SelectItem
    With AxToolBar1
        Debug.Print( "SelectItem should not be fired while locked" )
    End With
End Sub

With AxToolBar1
    .Locked = True
    With .Items
        .Add("Disabled").Enabled = False
        .Add("Item 2")
        .Add("Item 3")
    End With
    .Refresh()
End With

C++

// SelectItem event - Occurs when the user selects the item.
void OnSelectItemToolBar1(LPDISPATCH Itm)
{
    /*
        Copy and paste the following directives to your header file as
        it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'
        #import <ExToolBar.dll>
        using namespace EXTOOLBARLib;
    */
    EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
    OutputDebugStringW( L"SelectItem should not be fired while locked" );
}

EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
spToolBar1->PutLocked(VARIANT_TRUE);
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Disabled",vtMissing,vtMissing)->PutEnabled(VARIANT_FALSE);
    var_Items->Add(L"Item 2",vtMissing,vtMissing);
    var_Items->Add(L"Item 3",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

// SelectItem event - Occurs when the user selects the item.
void __fastcall TForm1::ToolBar1SelectItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
    OutputDebugString( L"SelectItem should not be fired while locked" );
}

ToolBar1->Locked = true;
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Disabled",TNoParam(),TNoParam())->Enabled = false;
    var_Items->Add(L"Item 2",TNoParam(),TNoParam());
    var_Items->Add(L"Item 3",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

// SelectItem event - Occurs when the user selects the item.
private void extoolbar1_SelectItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
    System.Diagnostics.Debug.Print( "SelectItem should not be fired while locked" );
}
//this.extoolbar1.SelectItem += new exontrol.EXTOOLBARLib.exg2antt.SelectItemEventHandler(this.extoolbar1_SelectItem);

extoolbar1.Locked = true;
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Disabled",null,null).Enabled = false;
    var_Items.Add("Item 2",null,null);
    var_Items.Add("Item 3",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<SCRIPT FOR="ToolBar1" EVENT="SelectItem(Itm)" LANGUAGE="JScript">
    alert( "SelectItem should not be fired while locked" );
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    ToolBar1.Locked = true;
    var var_Items = ToolBar1.Items;
        var_Items.Add("Disabled",null,null).Enabled = false;
        var_Items.Add("Item 2",null,null);
        var_Items.Add("Item 3",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<SCRIPT LANGUAGE="VBScript">
Function ToolBar1_SelectItem(Itm)
    With ToolBar1
        alert( "SelectItem should not be fired while locked" )
    End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        .Locked = True
        With .Items
            .Add("Disabled").Enabled = False
            .Add "Item 2"
            .Add "Item 3"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// SelectItem event - Occurs when the user selects the item.
private void axToolBar1_SelectItem(object sender, AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent e)
{
    System.Diagnostics.Debug.Print( "SelectItem should not be fired while locked" );
}
//this.axToolBar1.SelectItem += new AxEXTOOLBARLib._IToolBarEvents_SelectItemEventHandler(this.axToolBar1_SelectItem);

axToolBar1.Locked = true;
EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Disabled",null,null).Enabled = false;
    var_Items.Add("Item 2",null,null);
    var_Items.Add("Item 3",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

// SelectItem event - Occurs when the user selects the item.
void onEvent_SelectItem(COM _Itm)
{
    ;
    print( "SelectItem should not be fired while locked" );
}

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    extoolbar1.Locked(true);
    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Disabled")); com_Item = var_Item;
        com_Item.Enabled(false);
        com_Items.Add("Item 2");
        com_Items.Add("Item 3");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

// SelectItem event - Occurs when the user selects the item.
procedure TWinForm1.AxToolBar1_SelectItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent);
begin
    with AxToolBar1 do
    begin
        OutputDebugString( 'SelectItem should not be fired while locked' );
    end
end;

with AxToolBar1 do
begin
    Locked := True;
    with Items do
    begin
        Add('Disabled',Nil,Nil).Enabled := False;
        Add('Item 2',Nil,Nil);
        Add('Item 3',Nil,Nil);
    end;
    Refresh();
end

Delphi (standard)

// SelectItem event - Occurs when the user selects the item.
procedure TForm1.ToolBar1SelectItem(ASender: TObject; Itm : IItem);
begin
    with ToolBar1 do
    begin
        OutputDebugString( 'SelectItem should not be fired while locked' );
    end
end;

with ToolBar1 do
begin
    Locked := True;
    with Items do
    begin
        Add('Disabled',Null,Null).Enabled := False;
        Add('Item 2',Null,Null);
        Add('Item 3',Null,Null);
    end;
    Refresh();
end

VFP

*** SelectItem event - Occurs when the user selects the item. ***
LPARAMETERS Itm
    with thisform.ToolBar1
        DEBUGOUT( "SelectItem should not be fired while locked" )
    endwith

with thisform.ToolBar1
    .Locked = .T.
    with .Items
        .Add("Disabled").Enabled = .F.
        .Add("Item 2")
        .Add("Item 3")
    endwith
    .Refresh
endwith

dBASE Plus

/*
with (this.ACTIVEX1.nativeObject)
    SelectItem = class::nativeObject_SelectItem
endwith
*/
// Occurs when the user selects the item.
function nativeObject_SelectItem(Itm)
    local oToolBar
    oToolBar = form.Activex1.nativeObject
    ? "SelectItem should not be fired while locked"
return

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
oToolBar.Locked = true
var_Items = oToolBar.Items
    // var_Items.Add("Disabled").Enabled = false
    var_Item = var_Items.Add("Disabled")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Enabled = false]
    endwith
    var_Items.Add("Item 2")
    var_Items.Add("Item 3")
oToolBar.Refresh()

XBasic (Alpha Five)

' Occurs when the user selects the item.
function SelectItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
    Dim oToolBar as P
    oToolBar = topparent:CONTROL_ACTIVEX1.activex
    ? "SelectItem should not be fired while locked"
end function

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
oToolBar.Locked = .t.
var_Items = oToolBar.Items
    ' var_Items.Add("Disabled").Enabled = .f.
    var_Item = var_Items.Add("Disabled")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Enabled = False"

    var_Items.Add("Item 2")
    var_Items.Add("Item 3")
oToolBar.Refresh()

Visual Objects

METHOD OCX_Exontrol1SelectItem(Itm) CLASS MainDialog
    // SelectItem event - Occurs when the user selects the item.
    OutputDebugString(String2Psz( "SelectItem should not be fired while locked" ))
RETURN NIL

local var_Items as IItems

oDCOCX_Exontrol1:Locked := true
var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Disabled",nil,nil):Enabled := false
    var_Items:Add("Item 2",nil,nil)
    var_Items:Add("Item 3",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

/*begin event SelectItem(oleobject Itm) - Occurs when the user selects the item.*/
/*
    OleObject oToolBar
    oToolBar = ole_1.Object
    MessageBox("Information",string( "SelectItem should not be fired while locked" ))
*/
/*end event SelectItem*/

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
oToolBar.Locked = true
var_Items = oToolBar.Items
    var_Items.Add("Disabled").Enabled = false
    var_Items.Add("Item 2")
    var_Items.Add("Item 3")
oToolBar.Refresh()

Visual DataFlex

// Occurs when the user selects the item.
Procedure OnComSelectItem Variant llItm
    Forward Send OnComSelectItem llItm
    Showln "SelectItem should not be fired while locked"
End_Procedure

Procedure OnCreate
    Forward Send OnCreate
    Set ComLocked to True
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Disabled" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComEnabled of hoItem to False
        Send Destroy to hoItem
        Get ComAdd of hoItems "Item 2" Nothing Nothing to Nothing
        Get ComAdd of hoItems "Item 3" Nothing Nothing to Nothing
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

PROCEDURE OnSelectItem(oToolBar,Itm)
    DevOut( "SelectItem should not be fired while locked" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:SelectItem := {|Itm| OnSelectItem(oToolBar,Itm)} /*Occurs when the user selects the item.*/

        oToolBar:Locked := .T.
        oItems := oToolBar:Items()
            oItems:Add("Disabled"):Enabled := .F.
            oItems:Add("Item 2")
            oItems:Add("Item 3")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property Notifier

property ToolBar.Notifier as Long
Retrieves or sets the handle of the window that receives notifications/WM_COMMAND messages.

Type | Description
Long | A Long expression that specifies the handle of the window that receives the WM_COMMAND when the user selects, check/uncheck, edit an item.
The trial/evaluation version of the control limits firing the event/WM_COMMAND. In other words, using the trial/evaluation version won't fire the event/WM_COMMAND every time.

By default, the Notifier property is 0, which indicates that the property has no effect. Set the Notifier property to a window that you want to receive notification of the control through the WM_COMMAND message. For instance, in VFP or C++ it would be easier to handle the events of the control using the WM_COMMAND messages, rather than using sink interfaces.

The wParam parameter of the WM_COMMAND message carries the identifier of the event which occurred like listed bellow:

  • 0 ( exSelectItem ), occurs when the user selects/clicks an item
  • 1 ( exCheckItem ), occurs when the user clicks the item's check box, or check the item's checkbox
  • 2 ( exUncheckItem ), occurs when the user clicks the item's check box, or uncheck the item's checkbox
  • 3 ( exEditChangeItem ), occurs when the content of the item's editor is changed.

The lParam parameter of the WM_COMMAND message carries the identifier of the item who fired the event. You can use the Item property to access the control's item giving its identifier. The ID property specifies the item's identifier.

In VFP, you have to assign the hWnd property of the form to the Notifier property of the control as follows:

toolbar.Notifier = thisform.HWnd

while the following code:

BINDEVENT( thisform.HWnd, 273, thisform, "oncommand" )

adds a handler oncommand for the WM_COMMAND message ( 273 or 0x111 in hexa, is the identifier of the WM_COMMAND message ).

The oncommand may look like:

LPARAMETERS hWnd, uMsg, wParam, lParam

?wParam

*CheckItem
IF ( wParam = 1 ) then
    thisform.toolbar_CheckItem(lParam)
ELSE
    * UncheckItem
    IF ( wParam = 2 ) then
        thisform.toolbar_UncheckItem(lParam)
    ENDIF
ENDIF


property Picture

property ToolBar.Picture as IPictureDisp
Retrieves or sets a graphic to be displayed in the control.

Type | Description
IPictureDisp | A Picture object that indicates the control's picture.
By default, the control has no picture associated. The control uses the PictureDisplay property to determine how the picture is displayed on the control's background. Use the Picture property to display a picture on the control's background.


property PictureDisplay

property ToolBar.PictureDisplay as PictureDisplayEnum
Retrieves or sets a value that indicates the way how the graphic is displayed on the control's background

Type | Description
PictureDisplayEnum | A PictureDisplayEnum expression that indicates the way how the control's picture is displayed.
By default, the PictureDisplay property is exTile. The PictureDisplay property specifies how the Picture is displayed on the control's background. If the control has no picture associated the PictureDisplay property has no effect.


property PopupAppearance

property ToolBar.PopupAppearance as ToolBarAppearanceEnum
Retrieves or sets a value that indicates the menu's appearance.

Type | Description
ToolBarAppearanceEnum | A ToolBarAppearanceEnum expression that specifies the popup's frame appearance, or a color expression whose last 7 bits in the high significant byte of the value indicates the index of the skin in the Appearance collection, being displayed as control's borders. For instance, if the Appearance = 0x1000000, indicates that the first skin object in the Appearance collection defines the control's border. The Client object in the skin, defines the client area of the control. The list/hierarchy, scrollbars are always shown in the control's client area. The skin may contain transparent objects, and so you can define round corners. The normal.ebn file contains such of objects. Use the eXButton's Skin builder to view or change this file
By default, the PopupAppearance property is NoBorder. The Background(exMenuFlatLineColor) property indicates the color of line that divides the left to right side of the menu, when the PopupFlatAppearance property is True. The PopupFlatBackColor property indicates the color to show the left part of the menu, when the PopupFlatAppearance property is True. The BackColor property specifies the menu's background color. The Background(exMenuSeparatorItem) property specifies the visual appearance of the separator items.


property PopupFlatAppearance

property ToolBar.PopupFlatAppearance as Boolean
Specifies whether the control shows a flat appearance for sub-menus.

Type | Description
Boolean | A Boolean expression that specifies whether the popup menu displays the flay/gray portion to the left.
By default, the PopupFlatAppearance property is True. Use the Popup FlatBackColor property to specify the background color of the left side of the popup. Use the PopupFlatImageWidth property to specify the width of the column that displays icons/images/check or radio buttons.


property PopupFlatBackColor

property ToolBar.PopupFlatBackColor as Color
Specifies the color to left part of the menu.

Type | Description
Color | A Color expression that indicates the control's background color. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
Use the PopupFlatBackColor property to specify the background color of the left side of the popup. This property has effect while the control's PopupFlatAppearance property is True. The BackColor property specifies the control's background color. The ForeColor property specifies the control's foreground color. The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The SelForeColor property specifies the foreground color of the item being selected / highlighted. The Background property specifies the visual appearance for different parts of the control. The Appearance property specifies the menu's frame appearance. The Background(exMenuFlatLineColor) property indicates the color of line that divides the left to right side of the popup menu.


property PopupFlatImageWidth

property ToolBar.PopupFlatImageWidth as Long
Specifies the width of the column to display the icons/images when the control's PopupFlatAppearance is True.

Type | Description
Long | A Long expression that specifies the width of the column that displays icons/images/check or radio buttons, when the control's PopupFlatAppearance is True.
By default, the PopupFlatImageWidth property is 16 pixels wide. Use the PopupFlatImageWidth property to specify the width of the column that displays icons/images/check or radio buttons. The Image / HTMLImage property assigns an icon / picture to the item. The <img> tag can be used in the Caption property of the Item object to display an Icon or a custom-size picture.


property PopupIncrementalSearch

property ToolBar.PopupIncrementalSearch as IncrementalSearchEnum
Specifies how the control searches for the objects while user types characters.

Type | Description
IncrementalSearchEnum | An IncrementalSearchEnum expression that specifies the type of incremental searching the control performs once the user types characters on the context menu.
"In computing, incremental search, incremental find or real-time suggestions is a user interface interaction method to progressively search for and filter through text. As the user types text, one or more possible matches for the text are found and immediately presented to the user. " By default, the PopupIncrementalSearch property is exISearchStartWith + exISearchFilterFor, in other words, the control filter for items that match the typing characters. Use the PopupIncrementalSearch property on exNoIncrementalSearch to disable/prevent the incremental searching in your context menu. While the incremental search is on, the F3 or Shift + F3, finds the next occurrence or previously occurrence. The Back key deletes the last character of the incremental search string, while the Ctrl + Back key removes the entire incremental search string. If the PopupIncrementalSearch property is exNoIncrementalSearch, you can use the item's Shortcut property to define the key combination that the user can press to select the item quickly.

You can use the PopupIncrementalSearch property:

  • to highlight the items that match the typing characters
  • to display just the items that match the typing characters

The following screen shot shows the control with IncrementalSearch property on exISearchStartWith + exISearchFilterFor, while the user types "shi":

he following screen shot shows the control with IncrementalSearch property on exISearchStartWith, while the user types "shi":


property PopupVisibility

property ToolBar.PopupVisibility as Long
Specify the popup's visibility in percents: 90% is barely visible, and 10% is nearly opaque.

Type | Description
Long | A long expression that indicates the visibility of the popup menus.
By default, the Visibility is 100. Use the Visibility property to change the menu's visibility.

The following screen shot shows the menu when the Visibility is 100 ( opaque, by default ):

The following screen shot shows the menu when the Visibility is 80 ( semi-transparent ):


method Refresh

method ToolBar.Refresh ()
Refreshes the control.

Type Description
Call the Refresh method to refresh the control's content, which includes resizing/visibility of all including elements. Use the Update method to validate just the drawing area of the toolbar control. For instance, if you are changing the item's Caption, if an OleEvent occurs.


method ReplaceIcon

method ToolBar.ReplaceIcon ([Icon as Variant], [Index as Variant])

Adds a new icon, replaces an icon or clears the control's image list.

Type | Description
Icon as Variant | A long expression that indicates the icon's handle.
Index as Variant | A long expression that indicates the index where icon is inserted.
Return | Description
Long | A long expression that indicates the index of the icon in the images collection

Use the ReplaceIcon property to add, remove or replace an icon in the control's images collection. Also, the ReplaceIcon property can clear the images collection. Use the Images method to attach a image list to the control. The <img> tag can be used in the Caption property of the Item object. Also, the Image property assign an icon to the specified item.

The following VB sample adds a new icon to control's images list:

i = ToolBar1.ReplaceIcon( LoadPicture("d:\icons\help.ico").Handle), i specifies the index where the icon is added

The following VB sample replaces an icon into control's images list::

i = ToolBar1.ReplaceIcon( LoadPicture("d:\icons\help.ico").Handle, 0), i is zero, so the first icon is replaced.

The following VB sample removes an icon from control's images list:

ExToolBar1.ReplaceIcon 0, i, i specifies the index of icon removed.

The following VB clears the control's icons collection:

ExToolBar1.ReplaceIcon 0, -1


property RequiredHeight

property ToolBar.RequiredHeight as Long
Indicates the height to fit all elements within the control.

Type | Description
Long | A long expression that specifies the height to fit all elements within the control.
The RequiredHeight property gets the height (in pixels) required by the control all all visible items fit the control's client area. The RequiredWidth property gets the width (in pixels) required by the control all all visible items fit the control's client area.

The following samples show how you can get the required size, so all elements of the control fits its client area

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add "Item 1"
        .Add "Item 2"
    End With
    .Refresh
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

VB6

With ToolBar1
    With .Items
        .Add "Item 1"
        .Add "Item 2"
    End With
    .Refresh
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item 1")
        .Add("Item 2")
    End With
    .Refresh()
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item 1")
        .Add("Item 2")
    End With
    .Refresh()
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item 1",vtMissing,vtMissing);
    var_Items->Add(L"Item 2",vtMissing,vtMissing);
spToolBar1->Refresh();
OutputDebugStringW( _bstr_t(spToolBar1->GetRequiredWidth()) );
OutputDebugStringW( _bstr_t(spToolBar1->GetRequiredHeight()) );

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item 1",TNoParam(),TNoParam());
    var_Items->Add(L"Item 2",TNoParam(),TNoParam());
ToolBar1->Refresh();
OutputDebugString( PChar(ToolBar1->RequiredWidth) );
OutputDebugString( PChar(ToolBar1->RequiredHeight) );

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null);
extoolbar1.Refresh();
System.Diagnostics.Debug.Print( extoolbar1.RequiredWidth.ToString() );
System.Diagnostics.Debug.Print( extoolbar1.RequiredHeight.ToString() );

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item 1",null,null);
        var_Items.Add("Item 2",null,null);
    ToolBar1.Refresh();
    alert( ToolBar1.RequiredWidth );
    alert( ToolBar1.RequiredHeight );
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add "Item 1"
            .Add "Item 2"
        End With
        .Refresh
        alert( .RequiredWidth )
        alert( .RequiredHeight )
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null);
axToolBar1.Refresh();
System.Diagnostics.Debug.Print( axToolBar1.RequiredWidth.ToString() );
System.Diagnostics.Debug.Print( axToolBar1.RequiredHeight.ToString() );

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Items;
    anytype var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("Item 1");
        com_Items.Add("Item 2");
    extoolbar1.Refresh();
    print( extoolbar1.RequiredWidth() );
    print( extoolbar1.RequiredHeight() );
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Nil,Nil);
        Add('Item 2',Nil,Nil);
    end;
    Refresh();
    OutputDebugString( RequiredWidth );
    OutputDebugString( RequiredHeight );
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Null,Null);
        Add('Item 2',Null,Null);
    end;
    Refresh();
    OutputDebugString( RequiredWidth );
    OutputDebugString( RequiredHeight );
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item 1")
        .Add("Item 2")
    endwith
    .Refresh
    DEBUGOUT( .RequiredWidth )
    DEBUGOUT( .RequiredHeight )
endwith

dBASE Plus

local oToolBar,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2")
oToolBar.Refresh()
? Str(oToolBar.RequiredWidth)
? Str(oToolBar.RequiredHeight)

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2")
oToolBar.Refresh()
? oToolBar.RequiredWidth
? oToolBar.RequiredHeight

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item 1",nil,nil)
    var_Items:Add("Item 2",nil,nil)
oDCOCX_Exontrol1:Refresh()
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:RequiredWidth) ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:RequiredHeight) ))

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2")
oToolBar.Refresh()
MessageBox("Information",string( String(oToolBar.RequiredWidth) ))
MessageBox("Information",string( String(oToolBar.RequiredHeight) ))

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "Item 1" Nothing Nothing to Nothing
        Get ComAdd of hoItems "Item 2" Nothing Nothing to Nothing
    Send Destroy to hoItems
    Send ComRefresh
    Showln (ComRequiredWidth(Self))
    Showln (ComRequiredHeight(Self))
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item 1")
            oItems:Add("Item 2")
        oToolBar:Refresh()
        DevOut( Transform(oToolBar:RequiredWidth(),"") )
        DevOut( Transform(oToolBar:RequiredHeight(),"") )

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property RequiredWidth

property ToolBar.RequiredWidth as Long
Indicates the width to fit all elements within the control.

Type | Description
Long | A long expression that specifies the width to fit all elements within the control.
The RequiredWidth property gets the width (in pixels) required by the control all all visible items fit the control's client area. The RequiredHeight property gets the height (in pixels) required by the control all all visible items fit the control's client area.

The following samples show how you can get the required size, so all elements of the control fits its client area

VBA (MS Access, Excell...)

With ToolBar1
    With .Items
        .Add "Item 1"
        .Add "Item 2"
    End With
    .Refresh
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

VB6

With ToolBar1
    With .Items
        .Add "Item 1"
        .Add "Item 2"
    End With
    .Refresh
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

VB.NET

With Extoolbar1
    With .Items
        .Add("Item 1")
        .Add("Item 2")
    End With
    .Refresh()
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

VB.NET for /COM

With AxToolBar1
    With .Items
        .Add("Item 1")
        .Add("Item 2")
    End With
    .Refresh()
    Debug.Print( .RequiredWidth )
    Debug.Print( .RequiredHeight )
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item 1",vtMissing,vtMissing);
    var_Items->Add(L"Item 2",vtMissing,vtMissing);
spToolBar1->Refresh();
OutputDebugStringW( _bstr_t(spToolBar1->GetRequiredWidth()) );
OutputDebugStringW( _bstr_t(spToolBar1->GetRequiredHeight()) );

C++ Builder

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item 1",TNoParam(),TNoParam());
    var_Items->Add(L"Item 2",TNoParam(),TNoParam());
ToolBar1->Refresh();
OutputDebugString( PChar(ToolBar1->RequiredWidth) );
OutputDebugString( PChar(ToolBar1->RequiredHeight) );

C#

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null);
extoolbar1.Refresh();
System.Diagnostics.Debug.Print( extoolbar1.RequiredWidth.ToString() );
System.Diagnostics.Debug.Print( extoolbar1.RequiredHeight.ToString() );

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item 1",null,null);
        var_Items.Add("Item 2",null,null);
    ToolBar1.Refresh();
    alert( ToolBar1.RequiredWidth );
    alert( ToolBar1.RequiredHeight );
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add "Item 1"
            .Add "Item 2"
        End With
        .Refresh
        alert( .RequiredWidth )
        alert( .RequiredHeight )
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item 1",null,null);
    var_Items.Add("Item 2",null,null);
axToolBar1.Refresh();
System.Diagnostics.Debug.Print( axToolBar1.RequiredWidth.ToString() );
System.Diagnostics.Debug.Print( axToolBar1.RequiredHeight.ToString() );

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Items;
    anytype var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("Item 1");
        com_Items.Add("Item 2");
    extoolbar1.Refresh();
    print( extoolbar1.RequiredWidth() );
    print( extoolbar1.RequiredHeight() );
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Nil,Nil);
        Add('Item 2',Nil,Nil);
    end;
    Refresh();
    OutputDebugString( RequiredWidth );
    OutputDebugString( RequiredHeight );
end

Delphi (standard)

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item 1',Null,Null);
        Add('Item 2',Null,Null);
    end;
    Refresh();
    OutputDebugString( RequiredWidth );
    OutputDebugString( RequiredHeight );
end

VFP

with thisform.ToolBar1
    with .Items
        .Add("Item 1")
        .Add("Item 2")
    endwith
    .Refresh
    DEBUGOUT( .RequiredWidth )
    DEBUGOUT( .RequiredHeight )
endwith

dBASE Plus

local oToolBar,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2")
oToolBar.Refresh()
? Str(oToolBar.RequiredWidth)
? Str(oToolBar.RequiredHeight)

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2")
oToolBar.Refresh()
? oToolBar.RequiredWidth
? oToolBar.RequiredHeight

Visual Objects

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item 1",nil,nil)
    var_Items:Add("Item 2",nil,nil)
oDCOCX_Exontrol1:Refresh()
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:RequiredWidth) ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:RequiredHeight) ))

PowerBuilder

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item 1")
    var_Items.Add("Item 2")
oToolBar.Refresh()
MessageBox("Information",string( String(oToolBar.RequiredWidth) ))
MessageBox("Information",string( String(oToolBar.RequiredHeight) ))

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "Item 1" Nothing Nothing to Nothing
        Get ComAdd of hoItems "Item 2" Nothing Nothing to Nothing
    Send Destroy to hoItems
    Send ComRefresh
    Showln (ComRequiredWidth(Self))
    Showln (ComRequiredHeight(Self))
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oItems := oToolBar:Items()
            oItems:Add("Item 1")
            oItems:Add("Item 2")
        oToolBar:Refresh()
        DevOut( Transform(oToolBar:RequiredWidth(),"") )
        DevOut( Transform(oToolBar:RequiredHeight(),"") )

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


property SelBackColor

property ToolBar.SelBackColor as Color
Retrieves or sets a value that indicates the selection background color.

Type | Description
Color | A Color expression that specifies the background color / visual appearance of the selected item. The last 7 bits in the high significant byte of the color indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.
The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The SelForeColor property specifies the foreground color of the item being selected / highlighted. The ForeColor property specifies the control's foreground color. The BackColor property specifies the control's background color. The Background property specifies the visual appearance for different parts of the control. The Appearance property specifies the menu's frame appearance.

The following screen shot shows the control's selection with the default colors:

The following screen shot shows the control's selection with a different visual appearance:


property SelForeColor

property ToolBar.SelForeColor as Color
Retrieves or sets a value that indicates the selection foreground color.

Type | Description
Color | A Color expression that specifies the forground color to show the selected / highlighted item.
Currently, the SelForeColor property is super-classed by the Background(exMenuHotForeColor) property. The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The ForeColor property specifies the control's foreground color. The BackColor property specifies the control's background color. The Background property specifies the visual appearance for different parts of the control. The Appearance property specifies the menu's frame appearance.


property ShortcutKeyAlignH

property ToolBar.ShortcutKeyAlignH as ShortcutKeyAlignEnum
Defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

Type | Description
ShortcutKeyAlignEnum | A ShortcutKeyAlignEnum expression that defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.
The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally / vertically. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyAlignV

property ToolBar.ShortcutKeyAlignV as ShortcutKeyAlignEnum
Defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items vertically.

Type | Description
ShortcutKeyAlignEnum | A ShortcutKeyAlignEnum expression that defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items vertically.
The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally / vertically. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyExtPaddingH

property ToolBar.ShortcutKeyExtPaddingH as String
Specifies the padding to be applied to the item (arranged horizontally) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

Type | Description
String | A String expression that specifies the padding to be applied to the item (arranged horizontally) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this. The list is separated by comma character and indicates left, top, right and bottom exterior padding.
By default, the ShortcutKeyExtPaddingH property is "width/4, height/4 , width/4 ,height/4". The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

For instance:

  • "4,4,4,4" indicates a fixed exterior padding.
  • "width/4, height/4 , width/4 ,height/4" indicates a relative exterior padding.

The ShortcutKeyExtPaddingH property supports the following predefined keywords:

  • width keyword, returns the width required to display the shortcut's caption
  • height keyword, returns the height required to display the shortcut's caption

This property/method supports predefined constants and operators/functions as described here.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyExtPaddingV

property ToolBar.ShortcutKeyExtPaddingV as String
Specifies the padding to be applied to the item (arranged vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

Type | Description
String | A String expression that specifies the padding to be applied to the item (arranged horizontally) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this. The list is separated by comma character and indicates left, top, right and bottom exterior padding.
By default, the ShortcutKeyExtPaddingV property is "width/4, height/4 , width/4 ,height/4". The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

For instance:

  • "4,4,4,4" indicates a fixed exterior padding.
  • "width/4, height/4 , width/4 ,height/4" indicates a relative exterior padding.

The ShortcutKeyExtPaddingV property supports the following predefined keywords:

  • width keyword, returns the width required to display the shortcut's caption
  • height keyword, returns the height required to display the shortcut's caption

This property/method supports predefined constants and operators/functions as described here.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyFormat

property ToolBar.ShortcutKeyFormat as String
Specifies the expression that determines the format (including HTML tags) to display the shortcut keys.

Type | Description
String | A String expression that defines the format (including HTML tags) to display the shortcut keys.
By default, The ShortcutKeyFormat property is "". The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

For instance:

  • "`<font ;14>` + caption", displays the shortcut keys with a different font's size.
  • "`<font Stencil>` + caption", displays the shortcut keys with a different font type
  • "`<c><font ;6><fgcolor 808080>` + sca + `</fgcolor></font><br><c>Key:` + keys" displays the full modifiers and keys the user has to press to activate / select the item.

The ShortcutKeyFormat property supports the following predefined keywords:

  • caption keyword defines the keys that the user should press to activate / select the item. The caption keyword includes no modifier keys already pressed. The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible. For instance "3", specifies that the user can press the 3-key to activate/select the item.
  • sca keyword defines the modifier keys associated with the shortcut. For instance, "ALT+SHIFT" specifies that the user should press the ALT plus SHIFT combination to select/activate the item
  • keys keyword defines the keys associated with the shortcut. For instance "3", specifies that the user can press the 3-key to activate/select the item.

This property/method supports predefined constants and operators/functions as described here.

The following properties customize the format/look the shortcut keys are displayed:

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

  • The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyPadding

property ToolBar.ShortcutKeyPadding as String
Specifies the UI shortcut key's content padding.

Type | Description
String | A String expression that indicates the UI shortcut key's content padding.
By default, the ShortcutKeyPadding property is "3,0,3,0". The ShortcutKeyPadding property specifies the UI shortcut key's content padding. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

  • The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyPressedModifers

property ToolBar.ShortcutKeyPressedModifers as ModifierKeyEnum
Indicates the combination of modifier keys whose shortcut keys are currently visible.

Type | Description
ModifierKeyEnum | A ModifierKeyEnum expression that indicates the combination of modifier keys whose shortcut keys are currently visible.
The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.


property ShortcutKeysInfo

property ToolBar.ShortcutKeysInfo as String
Returns the list of shortcut keys that are currently available.

Type | Description
String | A String expression that indicates the list of shortcut keys that are currently available.
The ShortcutKeysInfo property returns the list of shortcut keys that are currently available. You can use the ShortcutKeysInfo property to get the list of shortcut keys that currently the user can press at this moment. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT.

The ShortcutKeysInfo property may return information as follows:

ALT+1 Item 1[id=20]
ALT+2 Item 2[id=30]
ALT+3 Item 3[id=40]
ALT+3+1 Sub-Item 3.1[id=50]
ALT+3+2 Sub-Item 3.2[id=60]
ALT+3+3+3+3 Sub-Item 3.2[id=70]


property ShortcutKeyTransparent

property ToolBar.ShortcutKeyTransparent as Long
Indicates the percent of transparency the shortcut keys are being displayed with.

Type | Description
Long | A long expression indicates the percent of transparency the shortcut keys are being displayed with.

By default, the ShortcutKeyTransparent property is 0. The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

  • The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShortcutKeyVisible

property ToolBar.ShortcutKeyVisible as ShortcutKeyVisibleEnum
Gets or sets a value that specifies whether the control's shortcut keys are visible or hidden.

Type | Description
ShortcutKeyVisibleEnum | A ShortcutKeyVisibleEnum expression that specifies whether the control's shortcut keys are visible or hidden.
By default, the ShortcutKeyVisible property is exShowShortcutKeysToggleDelayed. The ShortcutKeyVisible property indicates the way the control shows the available keys when user presses any modifier keys such as SHIFT, CTRL or ALT. The Shortcut property specifies the key combination that the user can press to select the item quickly. The ShortcutKeysInfo property returns the list of shortcut keys that are currently available.

The following properties customize the format/look the shortcut keys are displayed:

  • The ShortcutKeyFormat property specifies the expression that defines the format (including HTML tags) to display the shortcut keys.

  • Background(exShortcutKeyAppearance) / Background(exShortcutKeyBackColor) / Background(exShortcutKeyForeColor) specifies the visual appearance of the shortcut's background / foreground

  • The ShortcutKeyTransparent property Indicates the percent of transparency the shortcut keys are being displayed with.

  • The ShortcutKeyPadding property specifies the UI shortcut key's content padding.

  • The ShortcutKeyExtPaddingH / ShortcutKeyExtPaddingV specifies the padding to be applied to the item (arranged horizontally/vertically) that displays the UI shortcut, so the ShortcutKeyAlign property aligns the UI shortcut relative to this.

  • The ShortcutKeyAlignH / ShortcutKeyAlignV defines the alignment of the UI shortcut keys relative to the item that displays it, when the holder arranges the items horizontally.

The ShortcutKeyPressedModifers property indicates the combination of modifier keys whose shortcut keys are currently visible.


property ShowCheckedAsSelected

property ToolBar.ShowCheckedAsSelected as ShowCheckedAsSelectedEnum
Specifies whether the checked items shows as selected.

Type | Description
ShowCheckedAsSelectedEnum | A ShowCheckedAsSelectedEnum expression that specifies whether the checked items show as selected.
By default, the ShowCheckedAsSelected property is exDisplayItemCheckDefault. Use the ShowCheckedAsSelected property on non zero, to show the checked items as selected. A checked item is an item with the Check or Radio property set on True and the Checked property is True. The SelBackColor property indicates the color to show background of the selected / highlighted item. The AllowToggleRadio property on True, allows a radio button to set on zero ( unchecked ), if the user clicks twice the radio button. The ShowCheckedAsSelected property of the Item object specifies whether the individual checked item is shown as selected.

The following screen shot shows the control when the ShowCheckedAsSelected property is exDisplayItemCheckDefault( by default ):

The following screen shot shows the control when the ShowCheckedAsSelected property is exDisplayItemCheckHighlight:


property ShowImageList

property ToolBar.ShowImageList as Boolean
Specifies whether the control's image list window is visible or hidden.

Type | Description
Boolean | A boolean expression that specifies whether the control's image list window is visible or hidden.
By default, the ShowImageList property is True. Use the ShowImageList property to hide the control's images list window. The control's images list window is visible only at design time. Use the Images method to associate an images list control to the control. The <img> tag can be used in the Caption property of the Item object. Also, the Image property assign an icon to the specified item. Use the ReplaceIcon method to add, remove or clear icons in the control's images collection.


property ShowPopupArrow

property ToolBar.ShowPopupArrow(ItemHighlited as Boolean) as ShowPopupArrowEnum
Indicates the type of the arrow to be shown when the item displays the sub-menu.

Type | Description
ItemHighlited as Boolean | A Boolean expression that specifies whether the arrow is shown to the selected/highlighted item. In VFP, you should use 0 or 1, instead .F. or .T.
ShowPopupArrowEnum | A ShowPopupArrowEnum expression that specifies the arrow to be shown on an item that displays a submenu.
By default, the ShowPopupArrow(True) property is exShowPopupArrowLight, and the ShowPopupArrow(False) property is exShowPopupArrowDark. In other words, when the item is selected/highlighted a light arrow is displayed, while when the item it is not selected/highlighted a dark arrow is displayed. Use the ShowPopupArrow property to specify how the item with sub-menu displays the popup arrow.


property ShowPopupEffect

property ToolBar.ShowPopupEffect as ShowPopupEffectEnum
Specifies the effect to show the popup menu when clicking an item, such as scrolling, lighting up, and so on.

Type | Description
ShowPopupEffectEnum | A ShowPopupEffectEnum expression that specifies effect to be applied when the user opens the menu or a sub-menu.
By default, ShowPopupEffect property is exShowPopupLightUp. Use the ShowPopupEffect property to disable the effect to be applied when the user opens the menu or any sub-menu.


method ShowToolTip

method Toolbar.ShowToolTip (ToolTip as String, [Title as Variant], [Alignment as Variant], [X as Variant], [Y as Variant])
Shows the specified tooltip at given position.

Type Description
ToolTip as String The ToolTip parameter can be any of the following:
  • NULL(BSTR) or "<null>"(string) to indicate that the tooltip for the object being hovered is not changed
  • A String expression that indicates the description of the tooltip, that supports built-in HTML format (adds, replaces or changes the object's tooltip)
Title as Variant The Title parameter can be any of the following:
  • missing (VT_EMPTY, VT_ERROR type) or "<null>"(string) the title for the object being hovered is not changed.
  • A String expression that indicates the title of the tooltip (no built-in HTML format) (adds, replaces or changes the object's title)
Alignment as Variant A long expression that indicates the alignment of the tooltip relative to the position of the cursor. If missing (VT_EMPTY, VT_ERROR) the alignment of the tooltip for the object being hovered is not changed.

The Alignment parameter can be one of the following:

  • 0 - exTopLeft
  • 1 - exTopRight
  • 2 - exBottomLeft
  • 3 - exBottomRight
  • 0x10 - exCenter
  • 0x11 - exCenterLeft
  • 0x12 - exCenterRight
  • 0x13 - exCenterTop
  • 0x14 - exCenterBottom

By default, the tooltip is aligned relative to the top-left corner (0 - exTopLeft).

X as Variant Specifies the horizontal position to display the tooltip as one of the following:
  • missing (VT_EMPTY, VT_ERROR type), indicates that the tooltip is shown on its default position / current cursor position (ignored)
  • -1, indicates the current horizontal position of the cursor (current x-position)
  • a numeric expression that indicates the horizontal screen position to show the tooltip (fixed screen x-position)
  • a string expression that indicates the horizontal displacement relative to default position to show the tooltip (moved)
Y as Variant Specifies the vertical position to display the tooltip as one of the following:
  • missing (VT_EMPTY, VT_ERROR type), indicates that the tooltip is shown on its default position / current cursor position (ignored)
  • -1, indicates the current vertical position of the cursor (current y-position)
  • a numeric expression that indicates the vertical screen position to show the tooltip (fixed screen y-position)
  • a string expression that indicates the vertical displacement relative to default position to show the tooltip (displacement)
Use the ShowToolTip method to display a custom tooltip at specified position or to update the object's tooltip, title or position. You can call the ShowToolTip method during the MouseMove event. Use the ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. The ToolTipDelay property specifies the time in ms that passes before the ToolTip appears. Use the ToolTipWidth property to specify the width of the tooltip window. Use the ToolTipFont property to change the tooltip's font. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color.

For instance:

  • ShowToolTip(`<null>`,`<null>`,,`+8`,`+8`), shows the tooltip of the object moved relative to its default position
  • ShowToolTip(`<null>`,`new title`), adds, changes or replaces the title of the object's tooltip
  • ShowToolTip(`new content`), adds, changes or replaces the object's tooltip
  • ShowToolTip(`new content`,`new title`), shows the tooltip and title at current position
  • ShowToolTip(`new content`,`new title`,,`+8`,`+8`), shows the tooltip and title moved relative to the current position
  • ShowToolTip(`new content`,``,,128,128), displays the tooltip at a fixed position
  • ShowToolTip(``,``), hides the tooltip

The ToolTip parameter supports the built-in HTML format like follows:

  • <b> ... </b> displays the text in bold
  • <i> ... </i> displays the text in italics
  • <u> ... </u> underlines the text
  • <s> ... </s> Strike-through text
  • <a id;options> ... </a> displays an anchor element that can be clicked. An anchor is a piece of text or some other object (for example an image) which marks the beginning and/or the end of a hypertext link.The <a> element is used to mark that piece of text (or inline image), and to give its hypertextual relationship to other documents. The control fires the AnchorClick(AnchorID, Options) event when the user clicks the anchor element. The FormatAnchor property customizes the visual effect for anchor elements.
  • <font face;size> ... </font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor rrggbb> ... </fgcolor> or <fgcolor=rrggbb> ... </fgcolor> displays text with a specified foreground color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <bgcolor rrggbb> ... </bgcolor> or <bgcolor=rrggbb> ... </bgcolor> displays text with a specified background color. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <solidline rrggbb> ... </solidline> or <solidline=rrggbb> ... </solidline> draws a solid-line on the bottom side of the current text-line, of specified RGB color. The <solidline> ... </solidline> draws a black solid-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <dotline rrggbb> ... </dotline> or <dotline=rrggbb> ... </dotline> draws a dot-line on the bottom side of the current text-line, of specified RGB color. The <dotline> ... </dotline> draws a black dot-line on the bottom side of the current text-line. The rr/gg/bb represents the red/green/blue values of the color in hexa values.
  • <upline> ... </upline> draws the line on the top side of the current text-line (requires <solidline> or <dotline>).
  • <r> right aligns the text
  • <c> centers the text
  • <br> forces a line-break
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number; ( the character with specified code ), For instance, the &#8364; displays the EUR character. The & ampersand is only recognized as markup when it is followed by a known letter or a #character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;
  • <off offset> ... </off> defines the vertical offset to display the text/element. The offset parameter defines the offset to display the element. This tag is inheritable, so the offset is keep while the associated </off> tag is found. You can use the <off offset> HTML tag in combination with the <font face;size> to define a smaller or a larger font to be displayed. For instance: Text with <font ;7><off 6>subscript displays the text such as: Text with subscript The Text with <font ;7><off -6>superscript displays the text such as: Text with subscript
  • <gra rrggbb;mode;blend> ... </gra> defines a gradient text. The text color or <fgcolor> defines the starting gradient color, while the rr/gg/bb represents the red/green/blue values of the ending color, 808080 if missing as gray. The mode is a value between 0 and 4, 1 if missing, and blend could be 0 or 1, 0 if missing. The <font> HTML tag can be used to define the height of the font. Any of the rrggbb, mode or blend field may not be specified. The <gra> with no fields, shows a vertical gradient color from the current text color to gray (808080). For instance the <font ;18><gra FFFFFF;1;1>gradient-center</gra></font> generates the following picture:
  • <out rrggbb;width> ... </out> shows the text with outlined characters, where rr/gg/bb represents the red/green/blue values of the outline color, 808080 if missing as gray, width indicates the size of the outline, 1 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><out 000000><fgcolor=FFFFFF>outlined</fgcolor></out></font> generates the following picture:
  • <sha rrggbb;width;offset> ... </sha> define a text with a shadow, where rr/gg/bb represents the red/green/blue values of the shadow color, 808080 if missing as gray, width indicates the size of shadow, 4 if missing, and offset indicates the offset from the origin to display the text's shadow, 2 if missing. The text color or <fgcolor> defines the color to show the inside text. The <font> HTML tag can be used to define the height of the font. For instance the <font ;31><sha>shadow</sha></font> generates the following picture:

    or <font ;31><sha 404040;5;0><fgcolor=FFFFFF>outline anti-aliasing</fgcolor></sha></font> gets:


property Template

property ToolBar.Template as String
Specifies the control's template.

Type | Description
String | A string expression that indicates the control's template.

The control's template uses the X-Script language to initialize the control's content. Use the Template property page of the control to update the control's Template property. Use the Template property to execute code by passing instructions as a string ( template string ). Use the ExecuteTemplate property to execute a template script and gets the result.

Most of our UI components provide a Template page that's accessible in design mode. No matter what programming language you are using, you can have a quick view of the component's features using the WYSWYG Template editor.

  • Place the control to your form or dialog.
  • Locate the Properties item, in the control's context menu, in design mode. If your environment doesn't provide a Properties item in the control's context menu, please try to locate in the Properties browser.
  • Click it, and locate the Template page.
  • Click the Help button. In the left side, you will see the component, in the right side, you will see a x-script code that calls methods and properties of the control.

The control's Template page helps user to initialize the control's look and feel in design mode, using the x-script language that's easy and powerful. The Template page displays the control on the left side of the page. On the right side of the Template page, a simple editor is displayed where user writes the initialization code. The control's look and feel is automatically updated as soon as the user types new instructions. The Template script is saved to the container persistence ( when Apply button is pressed ), and it is executed when the control is initialized at runtime. Any component that provides a WYSWYG Template page, provides a Template property. The Template property executes code from a string ( template string ).

The Template or x-script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline characters ) or ";" character. The ; character may be available only for newer versions of the components.

An x-script instruction/line can be one of the following:

  • Dim list of variables Declares the variables. Multiple variables are separated by commas. ( Sample: Dim h, h1, h2 )
  • variable = property( list of arguments ) Assigns the result of the property to a variable. The "variable" is the name of a declared variable. The "property" is the property name of the object in the context. The "list or arguments" may include variables or values separated by commas. ( Sample: h = InsertItem(0,"New Child") )
  • property( list of arguments ) = value Changes the property. The value can be a variable, a string, a number, a boolean value or a RGB value.
  • method( list of arguments ) Invokes the method. The "list or arguments" may include variables or values separated by commas.
  • { Beginning the object's context. The properties or methods called between { and } are related to the last object returned by the property prior to { declaration.
  • } Ending the object's context
  • object. property( list of arguments ).property( list of arguments ).... The .(dot) character splits the object from its property. For instance, the Columns.Add("Column1").HeaderBackColor = RGB(255,0,0), adds a new column and changes the column's header back color.

The x-script may uses constant expressions as follow:

  • boolean expression with possible values as True or False
  • numeric expression may starts with 0x which indicates a hexa decimal representation, else it should starts with digit, or +/- followed by a digit, and . is the decimal separator. Sample: 13 indicates the integer 13, or 12.45 indicates the double expression 12,45
  • date expression is delimited by # character in the format #mm/dd/yyyy hh:mm:ss#. Sample: #31/12/1971# indicates the December 31, 1971
  • string expression is delimited by " or ` characters. If using the ` character, please make sure that it is different than ' which allows adding comments inline. Sample: "text" indicates the string text.

Also , the template or x-script code may support general functions as follows:

  • Me property indicates the original object.
  • RGB(R,G,B) property retrieves an RGB value, where the R, G, B are byte values that indicates the R G B values for the color being specified. For instance, the following code changes the control's background color to red: BackColor = RGB(255,0,0)
  • LoadPicture(file) property loads a picture from a file or from BASE64 encoded strings, and returns a Picture object required by the picture properties.
  • CreateObject(progID) property creates and retrieves a single uninitialized object of the class associated with a specified program identifier.


property TemplateDef

property ToolBar.TemplateDef as Variant
Defines inside variables for the next Template/ExecuteTemplate call.

Type | Description
Variant | A string expression that indicates the Dim declaration, or any Object expression to be assigned to previously declared variables.
The TemplateDef property has been added to allow programming languages such as dBASE Plus to set control's properties with multiple parameters. It is known that programming languages such as dBASE Plus or XBasic from AlphaFive, does not support setting a property with multiple parameters. In other words, these programming languages does not support something like Property(Parameters) = Value, so our controls provide an alternative using the TemplateDef method. The first call of the TemplateDef should be a declaration such as "Dim a,b" which means the next 2 calls of the TemplateDef defines the variables a and b. The next call should be Template or ExecuteTemplate property which can use the variable a and b being defined previously.

So, calling the TemplateDef property should be as follows:

with (Control)
    TemplateDef = [Dim var_Column]
    TemplateDef = var_Column
    Template = [var_Column.Def(4) = 255]
endwith

This sample allocates a variable var_Column, assigns the value to the variable ( the second call of the TemplateDef ), and the Template call uses the var_Column variable ( as an object ), to call its Def property with the parameter 4.

Let's say we need to define the background color for a specified column, so we need to call the Def(exCellBackColor) property of the column, to define the color for all cells in the column.

The following VB6 sample shows setting the Def property such as:

With Control
    .Columns.Add("Column 1").Def(exCellBackColor) = 255
    .Columns.Add "Column 2"
    .Items.AddItem 0
    .Items.AddItem 1
    .Items.AddItem 2
End With

In dBASE Plus, calling the Def(4) has no effect, instead using the TemplateDef helps you to use properly the Def property as follows:

local Control,var_Column

Control = form.Activex1.nativeObject
// Control.Columns.Add("Column 1").Def(4) = 255
var_Column = Control.Columns.Add("Column 1")
with (Control)
    TemplateDef = [Dim var_Column]
    TemplateDef = var_Column
    Template = [var_Column.Def(4) = 255]
endwith
Control.Columns.Add("Column 2")
Control.Items.AddItem(0)
Control.Items.AddItem(1)
Control.Items.AddItem(2)

The equivalent sample for XBasic in A5, is as follows:

Dim Control as P
Dim var_Column as P

Control = topparent:CONTROL_ACTIVEX1.activex
' Control.Columns.Add("Column 1").Def(4) = 255
var_Column = Control.Columns.Add("Column 1")
Control.TemplateDef = "Dim var_Column"
Control.TemplateDef = var_Column
Control.Template = "var_Column.Def(4) = 255"

Control.Columns.Add("Column 2")
Control.Items.AddItem(0)
Control.Items.AddItem(1)
Control.Items.AddItem(2)

The samples just call the Column.Def(4) = Value, using the TemplateDef. The first call of TemplateDef property is "Dim var_Column", which indicates that the next call of the TemplateDef will defines the value of the variable var_Column, in other words, it defines the object var_Column. The last call of the Template property uses the var_Column member to use the x-script and so to set the Def property so a new color is being assigned to the column.

The TemplateDef, Template and ExecuteTemplate support x-script language ( Template script of the Exontrols ), like explained bellow:

The Template or x-script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline characters ) or ";" character. The ; character may be available only for newer versions of the components.

An x-script instruction/line can be one of the following:

  • Dim list of variables Declares the variables. Multiple variables are separated by commas. ( Sample: Dim h, h1, h2 )
  • variable = property( list of arguments ) Assigns the result of the property to a variable. The "variable" is the name of a declared variable. The "property" is the property name of the object in the context. The "list or arguments" may include variables or values separated by commas. ( Sample: h = InsertItem(0,"New Child") )
  • property( list of arguments ) = value Changes the property. The value can be a variable, a string, a number, a boolean value or a RGB value.
  • method( list of arguments ) Invokes the method. The "list or arguments" may include variables or values separated by commas.
  • { Beginning the object's context. The properties or methods called between { and } are related to the last object returned by the property prior to { declaration.
  • } Ending the object's context
  • object. property( list of arguments ).property( list of arguments ).... The .(dot) character splits the object from its property. For instance, the Columns.Add("Column1").HeaderBackColor = RGB(255,0,0), adds a new column and changes the column's header back color.

The x-script may uses constant expressions as follow:

  • boolean expression with possible values as True or False
  • numeric expression may starts with 0x which indicates a hexa decimal representation, else it should starts with digit, or +/- followed by a digit, and . is the decimal separator. Sample: 13 indicates the integer 13, or 12.45 indicates the double expression 12,45
  • date expression is delimited by # character in the format #mm/dd/yyyy hh:mm:ss#. Sample: #31/12/1971# indicates the December 31, 1971
  • string expression is delimited by " or ` characters. If using the ` character, please make sure that it is different than ' which allows adding comments inline. Sample: "text" indicates the string text.

Also , the template or x-script code may support general functions as follows:

  • Me property indicates the original object.
  • RGB(R,G,B) property retrieves an RGB value, where the R, G, B are byte values that indicates the R G B values for the color being specified. For instance, the following code changes the control's background color to red: BackColor = RGB(255,0,0)
  • LoadPicture(file) property loads a picture from a file or from BASE64 encoded strings, and returns a Picture object required by the picture properties.
  • CreateObject(progID) property creates and retrieves a single uninitialized object of the class associated with a specified program identifier.


method TemplatePut

method ToolBar.TemplatePut (NewVal as Variant)
Defines inside variables for the next Template/ExecuteTemplate call.

Type | Description
NewVal as Variant | A string expression that indicates the Dim declaration, or any Object expression to be assigned to previously declared variables.
The TemplatePut method / TemplateDef property has been added to allow programming languages such as dBASE Plus to set control's properties with multiple parameters. It is known that programming languages such as dBASE Plus or XBasic from AlphaFive, does not support setting a property with multiple parameters. In other words, these programming languages does not support something like Property(Parameters) = Value, so our controls provide an alternative using the TemplateDef / TemplatePut method. The first call of the TemplateDef should be a declaration such as "Dim a,b" which means the next 2 calls of the TemplateDef defines the variables a and b. The next call should be Template or ExecuteTemplate property which can use the variable a and b being defined previously.

The TemplateDef, TemplatePut, Template and ExecuteTemplate support x-script language ( Template script of the Exontrols ), like explained bellow:

The Template or x-script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline characters ) or ";" character. The ; character may be available only for newer versions of the components.

An x-script instruction/line can be one of the following:

  • Dim list of variables Declares the variables. Multiple variables are separated by commas. ( Sample: Dim h, h1, h2 )
  • variable = property( list of arguments ) Assigns the result of the property to a variable. The "variable" is the name of a declared variable. The "property" is the property name of the object in the context. The "list or arguments" may include variables or values separated by commas. ( Sample: h = InsertItem(0,"New Child") )
  • property( list of arguments ) = value Changes the property. The value can be a variable, a string, a number, a boolean value or a RGB value.
  • method( list of arguments ) Invokes the method. The "list or arguments" may include variables or values separated by commas.
  • { Beginning the object's context. The properties or methods called between { and } are related to the last object returned by the property prior to { declaration.
  • } Ending the object's context
  • object. property( list of arguments ).property( list of arguments ).... The .(dot) character splits the object from its property. For instance, the Columns.Add("Column1").HeaderBackColor = RGB(255,0,0), adds a new column and changes the column's header back color.

The x-script may uses constant expressions as follow:

  • boolean expression with possible values as True or False
  • numeric expression may starts with 0x which indicates a hexa decimal representation, else it should starts with digit, or +/- followed by a digit, and . is the decimal separator. Sample: 13 indicates the integer 13, or 12.45 indicates the double expression 12,45
  • date expression is delimited by # character in the format #mm/dd/yyyy hh:mm:ss#. Sample: #31/12/1971# indicates the December 31, 1971
  • string expression is delimited by " or ` characters. If using the ` character, please make sure that it is different than ' which allows adding comments inline. Sample: "text" indicates the string text.

Also , the template or x-script code may support general functions as follows:

  • Me property indicates the original object.
  • RGB(R,G,B) property retrieves an RGB value, where the R, G, B are byte values that indicates the R G B values for the color being specified. For instance, the following code changes the control's background color to red: BackColor = RGB(255,0,0)
  • LoadPicture(file) property loads a picture from a file or from BASE64 encoded strings, and returns a Picture object required by the picture properties.
  • CreateObject(progID) property creates and retrieves a single uninitialized object of the class associated with a specified program identifier.


property ToolTipDelay

property ToolBar.ToolTipDelay as Long
Specifies the time in ms that passes before the ToolTip appears.

Type | Description
Long | A long expression that specifies the time in ms that passes before the ToolTip appears.

If the ToolTipDelay or ToolTipPopDelay property is 0, the control displays no tooltips. Use the ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. Use the ToolTipWidth property to specify the width of the tooltip window. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color. Use the ToolTip property to assign a tooltip to an item. Use the ToolTipFont property or <font> HTML element to assign a new font for tooltips.


property ToolTipFont

property ToolBar.ToolTipFont as IFontDisp
Retrieves or sets the tooltip's font.

Type | Description
IFontDisp | A Font object being used to display the tooltip.
Use the ToolTipFont property to assign a font for the control's tooltip. The ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. Use the ToolTipWidth property to specify the width of the tooltip window. You can use the <font> HTML element, in the tooltip's description to assign a different font for portions of text. Use the ToolTip property to assign a tooltip to an item


property ToolTipPopDelay

property ToolBar.ToolTipPopDelay as Long
Specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control.

Type | Description
Long | A long expression that specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control.

If the ToolTipDelay or ToolTipPopDelay property is 0, the control displays no tooltips. The ToolTipDelay property specifies the time in ms that passes before the ToolTip appears. Use the ToolTipWidth property to specify the width of the tooltip window. Use the ToolTipFont property to assign a font for the control's tooltip. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color. Use the ToolTip property to assign a tooltip to an item


property ToolTipWidth

property ToolBar.ToolTipWidth as Long
Specifies a value that indicates the width of the tooltip window, in pixels.

Type | Description
Long | A long expression that indicates the width of the tooltip window, in pixels.

Use the ToolTipWidth property to change the tooltip window width. The height of the tooltip window is automatically computed based on tooltip's description. The ToolTipPopDelay property specifies the period in ms of time the ToolTip remains visible if the mouse pointer is stationary within a control. The ToolTipDelay property specifies the time in ms that passes before the ToolTip appears. Use the ToolTipFont property to assign a font for the control's tooltip. Use the Background(exToolTipAppearance) property indicates the visual appearance of the borders of the tooltips. Use the Background(exToolTipBackColor) property indicates the tooltip's background color. Use the Background(exToolTipForeColor) property indicates the tooltip's foreground color. Use the ToolTip property to assign a tooltip to an item


property ToString

property ToolBar.ToString as String
Loads or saves the Items collection using string representation (shortcut of Items.ToString property).

Type | Description
String | A String expression that specifies the items to be added. The list of items is separated by , (comma) character, while sub-menus are include between () parenthesis. The [] brackets indicates the options to be applied on the item
The ToString property of the control is equivalent with the ToString property of the Items object.

The ToString syntax in BNF notation:

<ToString> ::= <ITEMS>
<ITEMS> ::= <ITEM>["("<ITEMS>")"][","<ITEMS>]
<ITEM> ::= <CAPTION>[<OPTIONS>]
<OPTIONS> ::= "["<OPTION>"]"["["<OPTIONS>"]"]
<OPTION> ::= <PROPERTY>["="<VALUE>]
<PROPERTY> ::= "img" | "himg" | "sep" | "id" | "typ" | "group" | "chk" | "button" | "align" | "spchk" | "show" | "rad" | "dis" | "showdis" | "bld" | "itl" | "stk" | "und" | "bg" | "fg" | "edittype" | "edit" | "mask" | "border" | "editwidth" | "captionwidth" | "height" | "grp" | "tfi" | "ttp" | "min" | "max" | "tick" | "freq" | "ticklabel" | "small" | "large" | "spin" | "ettp" | "float" | "close" | "local" | "popupapp" | "itemspad" | "itemsbg" | "itemsbghot" | "itemsbgext" | "visible" | "tab" | "pad" | "bghot" | "bgsel" | "bgselhot" | "arrow" | "popupalign" | "popupoffset" | "popupat"

where the <CAPTION> is the HTML caption to be shown on the context menu item. The <VALUE> indicates the value of giving property.

  • id=<VALUE>, where <VALUE> is an integer expression, that indicates the identifier of the item.
  • bg=<VALUE>, specifies the item's background color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bghot=<VALUE>, specifies the item's background color, while the cursor hovers the item, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bgsel=<VALUE>, specifies the item's background color, while the item is checked/selected, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • bgselhot=<VALUE>, specifies the item's background color, while the item is checked/selected and the cursor hovers it, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • fg=<VALUE>, specifies the item's foreground color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or a integer expression.
  • sep, specifies an separator item
  • dis, specifies a disabled item
  • showdis=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the item shows as disabled, but it is still enabled
  • bld, specifies that the item appears in bold
  • itl, specifies that the item appears in italics
  • stk, specifies that the item appears as strikeout
  • und, specifies that the item is underlined
  • align=<VALUE>, where <VALUE> could be one of the following:
    • 0 ( left ), to align the item's caption to the left
    • 1 ( center ), to center the item's caption
    • 2 ( right ), to align the item's caption to the right
  • captionwidth=<VALUE>, specifies the width to show the HTML caption of the item. where <VALUE> could be a integer expression. A negative value indicates that no limitation is applied to the item's caption, so no truncate caption is shown
  • height=<VALUE>, specifies the height to show the item, where <VALUE> could be a positive integer expression
  • pad=<VALUE>, specifies the padding (space between the menu border and the item content) to display the item. The <VALUE> is a list of coordinates such as left,top,right,bottom
  • img=<VALUE>, where <VALUE> is an integer expression, that indicates the index of the icon being displayed for the item.
  • himg=<VALUE>, where <VALUE> indicates the key of the picture to be displayed for the item.

  • typ=<VALUE>, where <VALUE> could be one of the following:
    • 0 for default/regular items ( no check/radio button is associated with the item ),
    • 1 for items that display a check/box (chk),
    • 2 to display radio buttons (rad)
  • chk[=<VALUE>], where <VALUE> could be 0 for unchecked, or not zero for checked. The chk option makes the item to display a check box. If the <VALUE> is missing the item still displays an un-checked check box.
  • rad=<VALUE>, where <VALUE> could be 0 for unchecked radio button or not zero to for checked radio button. Use the grp option to define the group of radio where this button should be associated, If no group of radio buttons is required, the grp could be ignored.
  • grp=<VALUE>, defines the radio group. It should be used when you define more groups of radio buttons. A group of radio buttons means that only one item could be checked at one time. The rad option specifies that the item displays a radio button. Use the grp option to define the group of radio where this button should be associated, If no group of radio buttons is required, the grp could be ignored. The <VALUE> could be any integer expression.

  • show=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the checked item shows as selected
  • spchk=<VALUE>, where <VALUE> could be 0 for regular or not zero to specify whether the item's sub menu is shown only if the item is checked.

  • group=<VALUE>, where <VALUE> could be a bit-or combination (+) of the following values:
    • 0 (exNoGroupPopup), No grouping is performed on the sub-menu, so the sub-items are shown to a float popup,
    • 1 (exGroupPopup), Groups and displays the sub-menu items on the current item, arranged from left to right/horizontally
    • 2 (exNoGroupPopupFrame), Prevents showing the frame around each grouping item.
    • 4 (exGroupPopupCenter), Shows the grouping popup aligned to the center of the current item.
    • 8 (exGroupPopupRight), Shows the grouping popup aligned to the right of the current item.
    • 16 (exGroupPopupEqualWidth), Shows the items that make the group of the same width
    • 32 (exGroupPopupEqualHeight), Shows the items that make the group of the same height
    • 64 (exGroupPopupFrameSolidBox), Shows a solid frame around the grouped items
    • 128 (exGroupPopupFrameThickBox), Shows a solid thick-frame around the grouped items
    • 256 (exGroupPopupVertical), Groups and displays the sub-menu items on the current item, arranged from top to bottom/vertically

  • button=<VALUE>, where <VALUE> could be a bit-or combination (+) of the following values.
    • 0 (exShowAsButtonNone), No button is shown,
    • 1 (exShowAsButton), Shows the item as a button
    • 2 (exShowAsButtonAutoSize), Fits the button to cover the item's caption instead showing on the entire item
    • 17 (exShowAsSelectButton), Shows the item as a select button, which is composed by two-fields, one indicates the default button, while the second field specifies the drop down button that displays the items in the current's sub-menu collection. The drop down button is shown to the right-side of the default button. The item must have a submenu, else no drop down is displayed.
    • 273 (exShowAsSelectButtonBottom), Shows the item as a select button, which is composed by two-fields, one indicates the default button, while the second field specifies the drop down button that displays the items in the current's sub-menu collection. The drop down button is shown to the bottom-side of the default button. The item must have a submenu, else no drop down is displayed.

  • ttp=<VALUE>, defines the item's tooltip. The <VALUE> could be any HTML string expression. The item's tooltip is shown when the user hovers the item.

  • edittype=<VALUE>, associates an edit field to the item, where <VALUE> could be a combination of one or more of the following values:
    • 0 ( exItemDisableEdit ), No editor is assigned to the current item.
    • 1 ( exItemEditText ), A text-box editor is assigned to the current item.
    • 2 ( exItemEditMask ), A masked text-box editor is assigned to the current item.
    • 3 ( exItemEditSlider ), A slider editor is assigned to the current item. This can be combined with 1024.
    • 4 ( exItemEditProgress ), A progress editor is assigned to the current item. This can be combined with 1024.
    • 5 ( exItemEditScrollBar ), A scrollbar editor is assigned to the current item. This can be combined with 1024.
    • 6 ( exItemEditColor), A color editor is assigned to the current item.
    • 7 ( exItemEditFont ), A font editor is assigned to the current item.
    • 256 (exItemEditReadOnly), specifies that the item's editor is shown as disabled. This value could be combined with one of the values from 0 to 7 or 512
    • 512 ( exItemEditSpin ), A spin editor is assigned to the current item. This value could be combined with one of the values from 0 to 7 or 256
    • 1024 ( exItemEditVertical ), The editor is shown vertically rather than horizontally. This value has effect for exItemEditSlider, exItemEditProgress or exItemEditScrollBar
  • edit=<VALUE>, specifies the caption to be shown in the item's edit field, where <VALUE> could be any string
  • mask=<VALUE>, specifies the mask to be applied on a masked editor. This option is valid for exItemEditMask edit. Use the float option to allow masking floating point numbers. See Masking for more information about <VALUE> of the mask option. See Masking Float for more information about <VALUE> if the float option is used.
  • float=<VALUE>, Specifies whether the mask field masks a floating point number. This option is valid for exItemEditMask edit. See Masking Float for more information about <VALUE> of mask option, if the float option is used. The <VALUE> could be 0 for standard masking field or not zero to specify that the field is masking a floating point.
  • border=<VALUE>, specifies the border to be shown on the item's edit field, where <VALUE> could be one of the following:
    • 0 ( exEditBorderNone), No border is shown.
    • -1 (exEditBorderInset), shows an inset border
    • 1 (exEditBorderSingle), shows a frame border
  • editwidth=<VALUE>, specifies the width to show the edit field inside the item, where <VALUE> could be a integer expression. A negative value indicates that the field goes to the end of the item
  • min=<VALUE>, defines the minimum value of the edit field. The <VALUE> could be any integer expression, and specifies the minimum value for any slider, progress, scroll, spin, or range editor.
  • max=<VALUE>, defines the maximum value of the edit field. The <VALUE> could be any integer expression, and specifies the maximum value for any slider, progress, scroll, spin, or range editor.
  • tick=<VALUE>, defines where the ticks of the slider edit appear. This option is valid for exItemEditSlider edit. The <VALUE> could be one of the following values:
    • 0 ( exBottomRight ), The ticks are displayed on the bottom/right side.
    • 1 ( exTopLeft ), The ticks are displayed on the top/left side.
    • 2 ( exBoth ), The ticks are displayed on the both side.
    • 3 ( exNoTicks ), No ticks are displayed.
  • freq=<VALUE>, indicates the ratio of ticks on the slider edit. This option is valid for exItemEditSlider edit. The <VALUE> could be a positive integer expression.
  • ticklabel=<VALUE>, indicates the HTML label to be displayed on slider's ticks. This option is valid for exItemEditSlider edit. See Tick Label Expression for more information about <VALUE> of the ticklabel option.
  • small=<VALUE>, indicates the amount by which the edit's position changes when the user presses the arrow key ( left, right, or button ). This option is valid for exItemEditSlider, exItemEditScrollBar edit. The <VALUE> could be a positive integer expression.
  • large=<VALUE>, indicates the amount by which the edit's position changes when the user presses the CTRL + arrow key ( CTRL + left, CTRL + right). This option is valid for exItemEditSlider, exItemEditScrollBar edit. The <VALUE> could be a positive integer expression.
  • spin=<VALUE>, specifies the step to advance when user clicks the editor's spin.. This option is valid for exItemEditSpin edit. The <VALUE> could be a positive integer expression.
  • ettp=<VALUE>, specifies the HTML tooltip to be shown when the item's value is changed. This option is valid for exItemEditSlider/exItemEditScrollBar edit. The <VALUE> could be any string expression, including built-in HTML tags
  • arrow=<VALUE>. The <VALUE> could be 0 for hiding the arrow or not zero to show the arrow. Indicates whether an item that has a sub-menu shows or hides its popup arrow. If the <VALUE> is missing, the item shows no arrow.
  • local=<VALUE>. The <VALUE> could be 0 for standard popup or not zero to specify that the field is a local popup. Specifies whether the item's popup is shown as local. Clicking any item inside a local popup makes the popup itself to close including all its descendent sub-menus, without closing any ascendant sub-menus.
  • close=<VALUE>, Specifies the way the hosting menu is closed when the user clicks the item. If the close flag is missing, the <VALUE> is 3 (exCloseOnNonClickable), by default. The <VALUE> could be one of the following values:
    • 0 ( exCloseOnClick ), The popup menu is closing when the user clicks the item.
    • 1 ( exCloseOnDblClick ), The popup menu is closing when the user double clicks the item.
    • 2 ( exCloseOnClickOutside ), The popup menu is closing when the user clicks outside of the menu.
    • 3 ( exCloseOnNonClickable ), The popup menu is closing when the user clicks a non-clickable item ( regular items ). The non-clickable items is any item that's not a separator, popup, disabled or check or radio items, clicking a check-box item will makes the check box to change its state instead closing the context menu.
  • popupapp=<VALUE> indicates the visual appearance of the item's submenu when the popup is shown. The <VALUE> could be a predefine value like shown bellow, or an integer expression that refers an EBN object.
    • 0 ( NoBorder )
    • 1 ( FlatBorder )
    • 2 ( SunkenBorder )
    • 3 ( RaisedBorder )
    • 4 ( EtchedBorder )
    • 5 ( BumpBorder )
    • 6 ( ShadowBorder )
    • 7 ( InsetBorder )
    • 8 ( SingleBorder )
  • itemsbg=<VALUE>, specifies the items background color, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • itemsbghot=<VALUE>, specifies the items background color, while the cursor hovers the items, where <VALUE> could be a RGB expression ( RGB(RR,GG,BB), where RR is the red value, the GG is the green value, and the BB is the blue value), or an integer expression to that refers an EBN object.
  • popupalign=<VALUE>, Indicates how the item's sub-menu is aligned relative to the parent item. The popupalign has no effect for an item that displays a select- button. The <VALUE> could be a combination of one or more of the following values:
    • 0 ( exShowPopupAlignNone ), The popup menu is shown on top of the item, aligned to the left ( no down and right, so up and left )
    • 1 ( exShowPopupAlignDown ), The popup menu is shown down. If missing, the popup menu is shown up.
    • 2 ( exShowPopupAlignRight ), The popup menu is shown aligned to the right, else if missing, the popup menu is shown aligned to the left.
  • popupat=<VALUE>, specifies the identifier of the item where the current item's submenu/popup is displayed. The <VALUE> could be any integer expression. If there is no identifier with giving value, the option has no effect.
  • popupoffset=<VALUE>, specifies the offset (horizontal,vertical) to display the item's submenu/popup relative to its default position.
  • itemspad=<VALUE>, specifies the padding (space between the menu border and the item content) to display the items. The <VALUE> is a list of coordinates such as left,top,right,bottom
  • visible=<VALUE>, specifies the maximum number of visible items at one time, where the <VALUE> could be any integer expression.
  • tab=<VALUE>, specifies the identifier of the item/tab where the current group-popup is shown instead. The <VALUE> could be any integer expression. If there is no identifier with giving value, the option has no effect.
  • itemsbgext=<VALUE>, indicates additional colors, text, images that can be displayed on the items background using the EBN String Format. The <VALUE> should be in EBN String Format. For instance, [itemsbgext=bottom[2],bottom[16,text=`</fgcolor><fgcolor 6D6AAA>Views</fgcolor><fgcolor A0A0A0>`,align=0x21]], shows the Views aligned to the bottom, with a different foreground color.

Masking, (mask option)

For instance, the following input-mask ( ext-phone )

!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid character,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."

indicates the following:

  • The pattern should contain 3 optional digits 999, and 7 required digits 000 0000, aligned to the right, !.
  • The second part of the input mask indicates 1, which means that all literals are included when the user leaves the field.
  • The entire field is selected when it receives the focus, select=1
  • The field supports empty value, so the user can leave the field with no content
  • The field enters in overtype mode, and insert-type mode is not allowed when user pressed the Insert key
  • If the user enters any invalid character, a warning tooltip with the message "invalid character" is displayed.
  • If the user tries to leave the field, while the field is not validated ( all 7 required digits completed ), the invalid tooltip is shown with the message "The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." The <%mask%> is replaced with the first part of the input mask !(999) 000 0000

The four parts of an input mask, or the Mask property supports up to four parts, separated by a semicolon (;). For instance, "`Time: `00:00:00;;0;overtype,warning=<fgcolor FF0000>invalid character,beep", indicates the pattern "00:00" with the prefix Time:, the masking character being the 0, instead _, the field enters in over-type mode, insert-type mode is not allowed, and the field beeps and displays a tooltip in red with the message invalid character when the user enters an invalid character.

Input masks are made up one mandatory part and three optional parts, and each part is separated by a semicolon (;). If a part should use the semicolon (;) it must uses the \; instead

The purpose of each part is as follows:

  1. The first part (pattern) is mandatory. It includes the mask characters or string (series of characters) along with placeholders and literal data such as, parentheses, periods, and hyphens.

    The following table lists the placeholder and literal characters for an input mask and explains how it controls data entry:

    • #, a digit, +, - or space (entry not required).
    • 0, a digit (0 through 9, entry required; plus [+] and minus [-] signs not allowed).
    • 9, a digit or space (entry not required; plus and minus signs not allowed).
    • x, a lower case hexa character, [0-9],[a-f] ( entry required )
    • X, an upper case hexa character, [0-9],[A-F] ( entry required )
    • A, any letter, digit (entry required).
    • a, any letter, digit or space (entry optional).
    • L, any letter (entry require).
    • ?, any letter or space (entry optional).
    • &, any character or a space (entry required).
    • C, any character or a space (entry optional).
    • >, any letter, converted to uppercase (entry required).
    • <, any letter, converted to lowercase (entry required).
    • *, any characters combinations
    • { min,max } (Range), indicates a number range. The syntax {min,max} (Range), masks a number in the giving range. The min and max values should be positive integers. For instance the mask {0,255} masks any number between 0 and 255.
    • [...] (Alternative), masks any characters that are contained in the [] brackets. For instance, the [abcdA-D] mask any character: a,b,c,d,A,B,C,D
    • \, indicates the escape character
    • », ( ALT + 175 ) causes the characters that follow to be converted to uppercase, until «( ALT + 174 ) is found.
    • «, ( ALT + 174 ) causes the characters that follow to be converted to lowercase, until »( ALT + 175 ) is found.
    • !, causes the input mask to fill from right to left instead of from left to right.

    Characters enclosed in double quotation ("" or ``) marks will be displayed literally. If this part should display/use the semicolon (;) character is should be included between double quotation ("" or ``) characters or as \; ( escape ).

  2. The second part is optional and refers to the embedded mask characters and how they are stored within the field. If the second part is set to 0 ( default, exClipModeLiteralsNone ), all characters are stored with the data, and if it is set to 1 (exClipModeLiteralsInclude), the literals are stored, not including the masking/placeholder characters, if 2 (exClipModeLiteralsExclude), just typed characters are stored, if 3(exClipModeLiteralsEscape), optional, required, editable and escaped entities are included. No double quoted text is included.
  3. The third part of the input mask is also optional and indicates a single character or space that is used as a placeholder. By default, the field uses the underscore (_). If you want to use another character, enter it in the third part of your mask. Only the first character is considered. If this part should display/use the semicolon (;) character is should be \; ( escape )
  4. The forth part of the input, indicates a list of options that can be applied to input mask, separated by comma(,) character.

    The known options for the forth part are:

    • float, indicates that the field is edited as a decimal number, integer. The first part of the input mask specifies the pattern to be used for grouping and decimal separators, and - if negative numbers are supported. If the first part is empty, the float is formatted as indicated by current regional settings. For instance, "##;;;float" specifies a 2 digit number in float format. The grouping, decimal, negative and digits options are valid if the float option is present.

    • grouping=value, Character used to separate groups of digits to the left of the decimal. Valid only if float is present. For instance ";;;float,grouping=" indicates that no grouping is applied to the decimal number (LOCALE_STHOUSAND)
    • decimal=value, Character used for the decimal separator. Valid only if float is present. For instance ";;;float,grouping= ,decimal=\," indicates that the decimal number uses the space for grouping digits to the left, while for decimal separator the comma character is used (LOCALE_SDECIMAL)
    • negative=value, indicates whether the decimal number supports negative numbers. The value should be 0 or 1. 1 means negative numbers are allowed. Else 0 or missing, the negative numbers are not accepted. Valid only if float is present.
    • digits=value, indicates the max number of fractional digits placed after the decimal separator. Valid only if float is present. For instance, ";;;float,digits=4" indicates a max 4 digits after decimal separator (LOCALE_IDIGITS)
    • password[=value], displays a black circle for any shown character. For instance, ";;;password", specifies that the field to be displayed as a password. If the value parameter is present, the first character in the value indicates the password character to be used. By default, the * password character is used for non-TrueType fonts, else the black circle character is used. For instance, ";;;password=*", specifies that the field to be displayed as a password, and use the * for password character. If the value parameter is missing, the default password character is used.
    • right, aligns the characters to the right. For instance, "(999) 999-9999;;;right" displays and masks a telephone number aligned to the right. readonly, the editor is locked, user can not update the content, the caret is available, so user can copy the text, excepts the password fields.
    • inserttype, indicates that the field enters in insert-type mode, if this is the first option found. If the forth part includes also the overtype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;inserttype,overtype", indicates that the field enter in insert-type mode, and over-type mode is allowed. The "##:##;;0;inserttype", indicates that the field enter in insert-type mode, and over-type mode is not allowed.
    • overtype, indicates that the field enters in over-type mode, if this is the first option found. If the forth part includes also the inserttype option, it indicates that the user can toggle the insert/over-type mode using the Insert key. For instance, the "##:##;;0;overtype,inserttype", indicates that the field enter in over-type mode, and insert-type mode is allowed. The "##:##;;0;overtype", indicates that the field enter in over-type mode, and insert-type mode is not allowed.
    • nocontext, indicates that the field provides no context menu when user right clicks the field. For instance, ";;;password,nocontext" displays a password field, where the user can not invoke the default context menu, usually when a right click occurs.
    • beep, indicates whether a beep is played once the user enters an invalid character. For instance, "00:00;;;beep" plays a beep once the user types in invalid character, in this case any character that's not a digit.
    • warning=value, indicates the html message to be shown when the user enters an invalid character. For instance, "00:00:00;;;warning=invalid character" displays a "invalid character" tooltip once the user types in invalid character, in this case any character that's not a digit. The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape )
    • invalid=value, indicates the html message to be displayed when the user enters an inappropriate value for the field. If the value is missing or empty, the option has no effect, so no validation is performed. If the value is a not-empty value, the validation is performed. If the value is single space, no message is displayed and the field is keep opened while the value is inappropriate. For instance, "!(999) 000 0000;;;invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field." displays the "The value you entered isn't appropriate for the input mask '...' specified for this field." tooltip once the user leaves the field and it is not-valid ( for instance, the field includes entities required and uncompleted ). The <%mask%> keyword in value, substitute the current mask of the field, while the <%value%> keyword substitutes the current value ( including the literals ). If this option should display/use the semicolon (;) character is should be \; ( escape ). This option can be combined with empty, validateas.
    • validateas=value, specifies the additional validation is done for the current field. If value is missing or 0 (exValidateAsNone), the option has no effect. The validateas option has effect only if the invalid option specifies a not-empty value. Currently, the value can be 1 (exValidateAsDate), which indicates that the field is validated as a date. For instance, having the mask "!00/00/0000;;0;empty,validateas=1,invalid=Invalid date!,warning=Invalid character!,select=4,overtype", indicates that the field is validate as date ( validateas=1 ).
    • empty, indicates whether the field supports empty values. This option can be used with invalid flag, which indicates that the user can leave the field if it is empty. If empty flag is present, the field displays nothing if no entity is completed ( empty ). Once the user starts typing characters the current mask is displayed. For instance, having the mask "!(999) 000 0000;;;empty,select=4,overtype,invalid=invalid phone number,beep", it specifies an empty or valid phone to be entered.
    • select=value, indicates what to select from the field when it got the focus. The value could be 0 ( nothing, exSelectNoGotFocus ), 1 ( select all, exSelectAllGotFocus ), 2 ( select the first empty and editable entity of the field, exSelectEditableGotFocus ), 3 ( moves the cursor to the beginning of the first empty and editable entity of the field, exMoveEditableGotFocus ), 4 ( select the first empty, required and editable entity of the field, exSelectRequiredEditableGotFocus ), 5 ( moves the cursor to the beginning of the first empty, required and editable entity of the field, exMoveRequiredEditableGotFocus ). For modes 2 and 4 the entire field is selected if no matching entity is found. For instance, "`Time:`XX:XX;;;select=1" indicates that the entire field ( including the Time: prefix ) is selected once it get the focus. The "`Time:`XX:XX;;;select=3", moves the cursor to first X, if empty, the second if empty, and so on

Experimental:
multiline, specifies that the field supports multiple lines.
rich, specifies that the field displays a rich type editor. By default, the standard edit field is shown
disabled, shows as disabled the field.

Masking-Float, (mask, float option)

The [mask=<VALUE>] property may indicate the followings, if the [float=-1] is present
  • negative number: if the first character in the mask is - ( minus ) the control supports negative numbers. Pressing the - key will toggle the sign of the number. The + sign is never displayed.
  • decimal symbol: the last character that's different than # ( digit ), or 0 (zero) indicates the decimal symbol. If it is not present the control mask a floating point number without decimals.
  • thousand symbol: the thousand symbol is the last character that's not a # ( digit ), 0 (zero) or it is not the decimal symbol as explained earlier, if present.
  • the maximum number of decimals in the number ( the # or 0 character after the decimal symbol )
  • the maximum number of digits in the integer part ( the number of # or 0 character before decimal symbol )
  • the 0 character indicates a leading-zero. The count of 0 (zero) characters before decimal character indicates the leading-zero for integer part of the control, while the count of 0 (zero) characters after the decimal separator indicates the leading-zero for decimal part of the control. For instance, the Mask on "-###,###,##0.00", while the control's Text property is 1, the control displays 1.00, if 1.1 if displays 1.10, and if empty, the 0.00 is displayed.

If the <VALUE> property is empty, the control takes the settings for the regional options like: Decimal Symbol , No. of digits after decimal, Digit grouping symbol.

Here are few samples:

The <VALUE>"-###.###.##0,00" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator ). This format displays leading-zeros.

The <VALUE>"-###.###.###,##" filter floating point numbers a number for German settings ( "," is the decimal sign, "." is the thousands separator )

The <VALUE>"-###,###,###.##" filter floating point numbers a number for English settings ( "." is the decimal sign, "," is the thousands separator )

The <VALUE>"####" indicates a max-4 digit number ( positive ) without a decimal symbol and without digit grouping

The <VALUE>"-##.#" filters a floating point number from the -99.9 to 99.9 ( "." is the decimal sign, no thousands separator )

The <VALUE>"#,###.##" filters a floating point number from the 0 to 9,999.99 with digit grouping ( "." is the decimal sign, "," is the thousands separator ).

Tick Label Expression, (ticklabel option)

For instance:

  • "value", shows the values for each tick.
  • " (value=current ? '<font ;12><fgcolor=FF0000>' : '' ) + value", shows the current slider's position with a different color and font.
  • "value = current ? value : ''", shows the value for the current tick only.
  • "( value = current ? '<b><font ;10>' : '' ) + (value array 'ab bc cd de ef fg gh hi ij jk kl' split ' ')" displays different captions for slider's values.

The The <VALUE> of [ticklabel] option is a formatted expression which result may include the HTML tags.

The The <VALUE> of [ticklabel] option indicates a formatting expression that may use the following predefined keywords:

  • value gets the slider's position to be displayed
  • current gets the current slider's value.
  • vmin gets the slider's minimum value.
  • vmax gets the slider's maximum value.
  • smin gets the slider's selection minimum value.
  • smax gets the slider's selection maximum value.

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for is

"expression ? true_part : false_part"

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

"expression array (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')".

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

"expression in (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

"expression switch (default,c1,c2,c3,...,cn)"

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:

    • #4/1/2009#, from hours 06:00 AM to 12:00 PM
    • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
    • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.

Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. For instance type(%0) = 8 specifies the cells that contains string values.

    Here's few predefined types:

    • 0 - empty ( not initialized )
    • 1 - null
    • 2 - short
    • 3 - long
    • 4 - float
    • 5 - double
    • 6 - currency
    • 7 - date
    • 8 - string
    • 9 - object
    • 10 - error
    • 11 - boolean
    • 12 - variant
    • 13 - any
    • 14 - decimal
    • 16 - char
    • 17 - byte
    • 18 - unsigned short
    • 19 - unsigned long
    • 20 - long on 64 bits
    • 21 - unsigned long on 64 bites
  • str (unary operator) converts the expression to a string
  • dbl (unary operator) converts the expression to a number
  • date (unary operator) converts the expression to a date, based on your regional settings
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS.

Other known operators for numbers are:

  • int (unary operator) retrieves the integer part of the number
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

Other known operators for strings are:

  • len (unary operator) retrieves the number of characters in the string
  • lower (unary operator) returns a string expression in lowercase letters
  • upper (unary operator) returns a string expression in uppercase letters
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names
  • ltrim (unary operator) removes spaces on the left side of a string
  • rtrim (unary operator) removes spaces on the right side of a string
  • trim (unary operator) removes spaces on both sides of a string
  • startwith (binary operator) specifies whether a string starts with specified string
  • endwith (binary operator) specifies whether a string ends with specified string
  • contains (binary operator) specifies whether a string contains another specified string
  • left (binary operator) retrieves the left part of the string
  • right (binary operator) retrieves the right part of the string
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on )
  • a count b (binary operator) retrieves the number of occurrences of the b in a
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result.
  • a split b, splits the a using the separator b, and returns an array. For instance, the "weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' '" gets the weekday as string. This operator can be used with the array

Other known operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel.
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance the timeF(1:23 PM) returns "13:23:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel.
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance the shortdateF(December 31, 1971 11:00 AM) returns "12/31/1971".
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format.
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel.
  • year (unary operator) retrieves the year of the date (100,...,9999)
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 )
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 )
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 )
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday )
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 )
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 )
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 )

The The <VALUE> of [ticklabel] option can display labels using the following built-in HTML tags:

  • <b>…</b> displays the text in bold.
  • <i>…</i> displays the text in italics.
  • <u>…</u> underlines the text.
  • <s>…</s> Strike-through text
  • <font face;size>…</font> displays portions of text with a different font and/or different size. For instance, the <font Tahoma;12>bit</font> draws the bit text using the Tahoma font, on size 12 pt. If the name of the font is missing, and instead size is present, the current font is used with a different size. For instance, <font ;12>bit</font> displays the bit text using the current font, but with a different size.
  • <fgcolor=RRGGBB>…</fgcolor> displays text with a specified foreground color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <bgcolor=RRGGBB>…</bgcolor> displays text with a specified background color. The RR, GG or BB should be hexa values and indicates red, green and blue values.
  • <br> a forced line-break
  • <solidline> The next line shows a solid-line on top/bottom side. If has no effect for a single line caption.
  • <dotline> The next line shows a dot-line on top/bottom side. If has no effect for a single line caption.
  • <upline> The next line shows a solid/dot-line on top side. If has no effect for a single line caption.
  • <r> Right aligns the text
  • <c> Centers the text
  • <img>number[:width]</img> inserts an icon inside the text. The number indicates the index of the icon being inserted. Use the Images method to assign a list of icons to your chart. The last 7 bits in the high significant byte of the number expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. The width is optional and indicates the width of the icon being inserted. Using the width option you can overwrite multiple icons getting a nice effect. By default, if the width field is missing, the width is 18 pixels.
  • <img>key[:width]</img> inserts a custom size picture into the text being previously loaded using the HTMLPicture property. The Key parameter indicates the key of the picture being displayed. The Width parameter indicates a custom size, if you require to stretch the picture, else the original size of the picture is used.
  • & glyph characters as &amp; ( & ), &lt; ( < ), &gt; ( > ), &qout; ( " ) and &#number ( the character with specified code ), For instance, the &#8364 displays the EUR character, in UNICODE configuration. The & ampersand is only recognized as markup when it is followed by a known letter or a # character and a digit. For instance if you want to display <b>bold</b> in HTML caption you can use &lt;b&gt;bold&lt;/b&gt;

EBN String Format, (itemsbgext option)

The EBN String Format syntax in BNF notation is defined like follows:

<EBN> ::= <elements> | <root> "(" [<elements>] ")"
<elements> ::= <element> [ "," <elements> ]
<root> ::= "root" [ <attributes> ] | [ <attributes> ]
<element> ::= <anchor> [ <attributes> ] [ "(" [<elements>] ")" ]
<anchor> ::= "none" | "left" | "right" | "client" | "top" | "bottom"
<attributes> ::= "[" [<client> ","] <attribute> [ "," <attributes> ] "]"
<client> ::= <expression> | <expression> "," <expression> "," <expression> "," <expression>
<expression> ::= <number> | <number> "%"
<attribute> ::= <backcolor> | <text> | <wordwrap> | <align> | <pattern> | <patterncolor> | <frame> | <framethick> | <data> | <others>
<equal> ::= "="
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<decimal> ::= <digit><decimal>
<hexadigit> ::= <digit> | "A" | "B"  "C" | "D" | "E"  "F"
<hexa> ::= <hexadigit><hexa>
<number> ::= <decimal> | "0x" <hexa>
<color> ::= <rgbcolor> | number
<rgbcolor> ::= "RGB" "(" <number> "," <number> "," <number> ")"
<string> ::= "`" <characters> "`" | "'" <characters> "'" | " <characters> "
<characters> ::= <char>|<characters>
<char> ::= <any_character_excepts_null>
<backcolor> ::= "back" <equal> <color>
<text> ::= "text" <equal> <string>
<align> ::= "align" <equal> <number>
<pattern> ::= "pattern" <equal> <number>
<patterncolor> ::= "patterncolor" <equal> <color>
<frame> ::= "frame" <equal> <color>
<data> ::= "data" <equal> <number> | <string>
<framethick> ::= "framethick"
<wordwrap> ::= "wordwrap"

Others like: pic, stretch, hstretch, vstretch, transparent, from, to are reserved for future use only.

Here's a few easy samples:

  • "[pattern=6]", shows the BDiagonal pattern on the object's background.

  • "[frame=RGB(255,0,0),framethick]", draws a red thick-border around the object.

  • "[frame=RGB(255,0,0),framethick,pattern=6,patterncolor=RGB(255,0,0)]", draws a red thick-border around the object, with a patter inside.

  • "[[patterncolor=RGB(255,0,0)](none[(4,4,100%-8,100%-8),pattern=0x006,patterncolor=RGB(255,0,0),frame=RGB(255,0,0),framethick])]", draws a red thick-border around the object, with a patter inside, with a 4-pixels wide padding:

  • "top[4,back=RGB(0,0,255)]", draws a blue line on the top side of the object's background, of 4-pixels wide.

  • "[text=`caption`,align=0x22]", shows the caption string aligned to the bottom-right side of the object's background.

  • "[text=`<img>flag</img>`,align=0x11]" shows the flag picture and the sweden string aligned to the bottom side of the object.

  • "left[10,back=RGB(255,0,0)]", draws a red line on the left side of the object's background, of 10-pixels wide.

  • "bottom[50%,pattern=6,frame]", shows the BDiagonal pattern with a border arround on the lower-half part of the object's background.

  • "root[text=`caption <b>2`,align=0x22](client[text=`caption <b>1`,align=0x20])", shows the caption 1 aligned to the bottom-left side, and the caption 2 to the bottom-right side


property ToTemplate

property ToolBar.ToTemplate ([DefaultTemplate as Variant]) as String
Generates the control's template.

Type | Description
DefaultTemplate as Variant | A String expression that defines the properties/methods to be generated. If missing, the control's automatically generates code for all properties.
String | A String expression that indicates the x--script code.
The ToTemplate property generates x-script from the control's content. The AllowCopyTemplate property specifies whether the Shift + Ctrl + Alt + Insert sequence copies the control's content to the clipboard, in template form. The Template property can be used to place the result of ToTemplate property. Use the ExecuteTemplate property to execute a template script and gets the result.

Here's how the x-script generated could look as:

Font
{
    Size = 7.8
}
ShortcutKeyPadding = "3,0,3,0"
Items
{
        Add("",2,10)
        {
            EditWidth = 40
            GroupPopup = 3
            Items
            {
                Add("Item <br><c><b>1",0,20)
                {
                    EditWidth = 40
                }
                Add("Item <br><c><b>2",0,30)
                {
                    EditWidth = 40
                }
                Add("Item <br><c><b>3",0,40)
                {
                    EditWidth = 40
                }
            }
        }
}
Refresh()

for toolbar control such as:

Most of our UI components provide a Template page that's accessible in design mode. No matter what programming language you are using, you can have a quick view of the component's features using the WYSWYG Template editor.

  • Place the control to your form or dialog.
  • Locate the Properties item, in the control's context menu, in design mode. If your environment doesn't provide a Properties item in the control's context menu, please try to locate in the Properties browser.
  • Click it, and locate the Template page.
  • Click the Help button. In the left side, you will see the component, in the right side, you will see a x-script code that calls methods and properties of the control.

The control's Template page helps user to initialize the control's look and feel in design mode, using the x-script language that's easy and powerful. The Template page displays the control on the left side of the page. On the right side of the Template page, a simple editor is displayed where user writes the initialization code. The control's look and feel is automatically updated as soon as the user types new instructions. The Template script is saved to the container persistence ( when Apply button is pressed ), and it is executed when the control is initialized at runtime. Any component that provides a WYSWYG Template page, provides a Template property. The Template property executes code from a string ( template string ).

The Template or x-script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline characters ) or ";" character. The ; character may be available only for newer versions of the components.

An x-script instruction/line can be one of the following:

  • Dim list of variables Declares the variables. Multiple variables are separated by commas. ( Sample: Dim h, h1, h2 )
  • variable = property( list of arguments ) Assigns the result of the property to a variable. The "variable" is the name of a declared variable. The "property" is the property name of the object in the context. The "list or arguments" may include variables or values separated by commas. ( Sample: h = InsertItem(0,"New Child") )
  • property( list of arguments ) = value Changes the property. The value can be a variable, a string, a number, a boolean value or a RGB value.
  • method( list of arguments ) Invokes the method. The "list or arguments" may include variables or values separated by commas.
  • { Beginning the object's context. The properties or methods called between { and } are related to the last object returned by the property prior to { declaration.
  • } Ending the object's context
  • object. property( list of arguments ).property( list of arguments ).... The .(dot) character splits the object from its property. For instance, the Columns.Add("Column1").HeaderBackColor = RGB(255,0,0), adds a new column and changes the column's header back color.

The x-script may uses constant expressions as follow:

  • boolean expression with possible values as True or False
  • numeric expression may starts with 0x which indicates a hexa decimal representation, else it should starts with digit, or +/- followed by a digit, and . is the decimal separator. Sample: 13 indicates the integer 13, or 12.45 indicates the double expression 12,45
  • date expression is delimited by # character in the format #mm/dd/yyyy hh:mm:ss#. Sample: #31/12/1971# indicates the December 31, 1971
  • string expression is delimited by " or ` characters. If using the ` character, please make sure that it is different than ' which allows adding comments inline. Sample: "text" indicates the string text.

Also , the template or x-script code may support general functions as follows:

  • Me property indicates the original object.
  • RGB(R,G,B) property retrieves an RGB value, where the R, G, B are byte values that indicates the R G B values for the color being specified. For instance, the following code changes the control's background color to red: BackColor = RGB(255,0,0)
  • LoadPicture(file) property loads a picture from a file or from BASE64 encoded strings, and returns a Picture object required by the picture properties.
  • CreateObject(progID) property creates and retrieves a single uninitialized object of the class associated with a specified program identifier.


method Update

method ToolBar.Update ()
Updates the control.

Type Description
The Update method invalidates the entire control, without resizing the elements inside. Use the Update method to update a particular item. The Update method does not re-computes the required size of the item, so it just validates the item's client area. The Refresh method refreshes the entire control, including resizing inside elements.


property UseVisualTheme

property ToolBar.UseVisualTheme as UIVisualThemeEnum
Specifies whether the control uses the current visual theme to display certain UI parts.

Type | Description
UIVisualThemeEnum | An UIVisualThemeEnum expression that specifies which UI parts of the control are shown using the current visual theme.
By default, the UseVisualTheme property is exDefaultVisualTheme, which means that all known UI parts are shown as in the current theme. The UseVisualTheme property may specify the UI parts that you need to enable or disable the current visual theme. The UI Parts are like header, filterbar, check-boxes, buttons and so on. The UseVisualTheme property has effect only a current theme is selected for your desktop. The UseVisualTheme property. Use the Appearance property of the control to provide your own visual appearance using the EBN files. The SelBackColor property specifies the visual appearance of the selected / highlighted item.

The following screen shot shows the control while the UseVisualTheme property is exDefaultVisualTheme:

since the second screen shot shows the same data as the UseVisualTheme property is exNoVisualTheme:


property Version

property ToolBar.Version as String
Retrieves the control's version.

Type | Description
String | A string expression that indicates the control's version.

The version property specifies the control's version.


property VisualAppearance

property ToolBar.VisualAppearance as Appearance
Retrieves the control's appearance.

Type | Description
Appearance | An Appearance object that holds a collection of skins.
Use the Add method to add or replace skins to the control. The skin method, in it's simplest form, uses a single graphic file (*.ebn) assigned to a part of the control. By using a collection of objects laid over the graphic, it is possible to define which sections of the graphic will be used as borders, corners and other possible elements, fixing them to their proper position regardless of the size of the part. Use the Appearance property to change the menu's frame using an EBN skin object. The SelBackColor property specifies the visual appearance of the item being selected / highlighted. The Background property specifies the visual appearance for different parts of the control, including the radio-buttons, check-boxes or separator items.

The following screen shot shows the control's frame using a different EBN file:


ExToolBar events
Tip The /COM object can be placed on a HTML page (with usage of the HTML object tag: <object classid="clsid:...">) using the class identifier: {8A047308-84CB-4B50-90D7-AFD27BB4639C}. The object's program identifier is: "Exontrol.ToolBar". The /COM object module is: "ExToolBar.dll"
The trial/evaluation version of the control limit firing the events. In other words, using the trial/evaluation version won't fire the event every time. The exToolBar component supports the following events:

Name | Description
CheckItem | Occurs when the user checks the item.
Click | Occurs when the user presses and then releases the left mouse button over the tree control.
DblClick | Occurs when the user dblclk the left mouse button over an object.
EditChange | Occurs when the user alters the item's text box field.
Event | Notifies the application once the control fires an event.
MouseDown | Occurs when the user presses a mouse button.
MouseMove | Occurs when the user moves the mouse.
MouseUp | Occurs when the user releases a mouse button.
OleEvent | Occurs when an inside ActiveX control fires an event.
SelectItem | Occurs when the user selects the item.
UncheckItem | Occurs when the user unchecks the item.


event CheckItem

event CheckItem (Itm as Item)
Occurs when the user checks the item.

Type | Description
Itm as Item | An Item object that indicates the item being checked.

The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The CheckItem event notifies your application once the user clicks the item's check-box. The Check property indicates whether the Item has associated a check box. The Checked property specifies whether the item is checked or unchecked. Use the Radio property to display a radio-button on the item. In C++ or VFP, you can use the Notifier to get notified through the WM_COMMAND message. The Checked property specifies whether the item is checked or unchecked. The UncheckedItem event notifies once the user un-checks the item.

Syntax for CheckItem event, /NET version, on:

private void CheckItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
}

Private Sub CheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles CheckItem
End Sub

Syntax for CheckItem event, /COM version, on:

private void CheckItem(object sender, AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent e)
{
}

void OnCheckItem(LPDISPATCH Itm)
{
}

void __fastcall CheckItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
}

procedure CheckItem(ASender: TObject; Itm : IItem);
begin
end;

procedure CheckItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent);
begin
end;

begin event CheckItem(oleobject Itm)
end event CheckItem

Private Sub CheckItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent) Handles CheckItem
End Sub

Private Sub CheckItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
End Sub

Private Sub CheckItem(ByVal Itm As Object)
End Sub

LPARAMETERS Itm

PROCEDURE OnCheckItem(oToolBar,Itm)
RETURN

Syntax for CheckItem event, /COM version (others), on:

<SCRIPT EVENT="CheckItem(Itm)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function CheckItem(Itm)
End Function
</SCRIPT>

Procedure OnComCheckItem Variant llItm
    Forward Send OnComCheckItem llItm
End_Procedure

METHOD OCX_CheckItem(Itm) CLASS MainDialog
RETURN NIL

void onEvent_CheckItem(COM _Itm)
{
}

function CheckItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
end function

function nativeObject_CheckItem(Itm)
return

The following samples show how you can get notified once the user checks an item:

VBA (MS Access, Excell...)

' CheckItem event - Occurs when the user checks the item.
Private Sub ToolBar1_CheckItem(ByVal Itm As Object)
    With ToolBar1
        Debug.Print( "CheckItem event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh
End With

VB6

' CheckItem event - Occurs when the user checks the item.
Private Sub ToolBar1_CheckItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
    With ToolBar1
        Debug.Print( "CheckItem event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh
End With

VB.NET

' CheckItem event - Occurs when the user checks the item.
Private Sub Extoolbar1_CheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.CheckItem
    With Extoolbar1
        Debug.Print( "CheckItem event on Itm object" )
    End With
End Sub

With Extoolbar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh()
End With

VB.NET for /COM

' CheckItem event - Occurs when the user checks the item.
Private Sub AxToolBar1_CheckItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent) Handles AxToolBar1.CheckItem
    With AxToolBar1
        Debug.Print( "CheckItem event on Itm object" )
    End With
End Sub

With AxToolBar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh()
End With

C++

// CheckItem event - Occurs when the user checks the item.
void OnCheckItemToolBar1(LPDISPATCH Itm)
{
    /*
        Copy and paste the following directives to your header file as
        it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'
        #import <ExToolBar.dll>
        using namespace EXTOOLBARLib;
    */
    EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
    OutputDebugStringW( L"CheckItem event on Itm object" );
}

EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

// CheckItem event - Occurs when the user checks the item.
void __fastcall TForm1::ToolBar1CheckItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
    OutputDebugString( L"CheckItem event on Itm object" );
}

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true;
ToolBar1->Refresh();

C#

// CheckItem event - Occurs when the user checks the item.
private void extoolbar1_CheckItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
    System.Diagnostics.Debug.Print( "CheckItem event on Itm object" );
}
//this.extoolbar1.CheckItem += new exontrol.EXTOOLBARLib.exg2antt.CheckItemEventHandler(this.extoolbar1_CheckItem);

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Check = true;
    var_Items.Add("Item",null,null).Check = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<SCRIPT FOR="ToolBar1" EVENT="CheckItem(Itm)" LANGUAGE="JScript">
    alert( "CheckItem event on Itm object" );
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Check = true;
        var_Items.Add("Item",null,null).Check = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<SCRIPT LANGUAGE="VBScript">
Function ToolBar1_CheckItem(Itm)
    With ToolBar1
        alert( "CheckItem event on Itm object" )
    End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Check = True
            .Add("Item").Check = True
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// CheckItem event - Occurs when the user checks the item.
private void axToolBar1_CheckItem(object sender, AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent e)
{
    System.Diagnostics.Debug.Print( "CheckItem event on Itm object" );
}
//this.axToolBar1.CheckItem += new AxEXTOOLBARLib._IToolBarEvents_CheckItemEventHandler(this.axToolBar1_CheckItem);

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Check = true;
    var_Items.Add("Item",null,null).Check = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

// CheckItem event - Occurs when the user checks the item.
void onEvent_CheckItem(COM _Itm)
{
    ;
    print( "CheckItem event on Itm object" );
}

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Check(true);
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Check(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

// CheckItem event - Occurs when the user checks the item.
procedure TWinForm1.AxToolBar1_CheckItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_CheckItemEvent);
begin
    with AxToolBar1 do
    begin
        OutputDebugString( 'CheckItem event on Itm object' );
    end
end;

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Check := True;
        Add('Item',Nil,Nil).Check := True;
    end;
    Refresh();
end

Delphi (standard)

// CheckItem event - Occurs when the user checks the item.
procedure TForm1.ToolBar1CheckItem(ASender: TObject; Itm : IItem);
begin
    with ToolBar1 do
    begin
        OutputDebugString( 'CheckItem event on Itm object' );
    end
end;

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Check := True;
        Add('Item',Null,Null).Check := True;
    end;
    Refresh();
end

VFP

*** CheckItem event - Occurs when the user checks the item. ***
LPARAMETERS Itm
    with thisform.ToolBar1
        DEBUGOUT( "CheckItem event on Itm object" )
    endwith

with thisform.ToolBar1
    with .Items
        .Add("Item").Check = .T.
        .Add("Item").Check = .T.
    endwith
    .Refresh
endwith

dBASE Plus

/*
with (this.ACTIVEX1.nativeObject)
    CheckItem = class::nativeObject_CheckItem
endwith
*/
// Occurs when the user checks the item.
function nativeObject_CheckItem(Itm)
    local oToolBar
    oToolBar = form.Activex1.nativeObject
    ? "CheckItem event on Itm object"
return

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Check = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Check = true]
    endwith
    // var_Items.Add("Item").Check = true
    var_Item1 = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.Check = true]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

' Occurs when the user checks the item.
function CheckItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
    Dim oToolBar as P
    oToolBar = topparent:CONTROL_ACTIVEX1.activex
    ? "CheckItem event on Itm object"
end function

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Check = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Check = True"

    ' var_Items.Add("Item").Check = .t.
    var_Item1 = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.Check = True"

oToolBar.Refresh()

Visual Objects

METHOD OCX_Exontrol1CheckItem(Itm) CLASS MainDialog
    // CheckItem event - Occurs when the user checks the item.
    OutputDebugString(String2Psz( "CheckItem event on Itm object" ))
RETURN NIL

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Check := true
    var_Items:Add("Item",nil,nil):Check := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

/*begin event CheckItem(oleobject Itm) - Occurs when the user checks the item.*/
/*
    OleObject oToolBar
    oToolBar = ole_1.Object
    MessageBox("Information",string( "CheckItem event on Itm object" ))
*/
/*end event CheckItem*/

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Check = true
    var_Items.Add("Item").Check = true
oToolBar.Refresh()

Visual DataFlex

// Occurs when the user checks the item.
Procedure OnComCheckItem Variant llItm
    Forward Send OnComCheckItem llItm
    Showln "CheckItem event on Itm object"
End_Procedure

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComCheck of hoItem to True
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComCheck of hoItem1 to True
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

PROCEDURE OnCheckItem(oToolBar,Itm)
    DevOut( "CheckItem event on Itm object" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:CheckItem := {|Itm| OnCheckItem(oToolBar,Itm)} /*Occurs when the user checks the item.*/

        oItems := oToolBar:Items()
            oItems:Add("Item"):Check := .T.
            oItems:Add("Item"):Check := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


event Click ()
Occurs when the user presses and then releases the left mouse button over the tree control.

Type Description


event DblClick

event DblClick (Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user dblclk the left mouse button over an object.

Type | Description
Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys.
X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in container coordinates.
Y as OLE_YPOS_PIXELS | A single that specifies the current Y location of the mouse pointer. The y values is always expressed in container coordinates
The DblClick event is fired when user double clicks the control. The ItemFromPoint(-1,-1) property gets the item from the cursor.

Syntax for DblClick event, /NET version, on:

private void DblClick(object sender,short   Shift,int   X,int   Y)
{
}

Private Sub DblClick(ByVal sender As System.Object,ByVal Shift As Short,ByVal X As Integer,ByVal Y As Integer) Handles DblClick
End Sub

Syntax for DblClick event, /COM version, on:

private void DblClick(object sender, AxEXToolBarLib._IToolBarEvents_DblClickEvent e)
{
}

void OnDblClick(short   Shift,long   X,long   Y)
{
}

void __fastcall DblClick(TObject *Sender,short   Shift,int   X,int   Y)
{
}

procedure DblClick(ASender: TObject; Shift : Smallint;X : Integer;Y : Integer);
begin
end;

procedure DblClick(sender: System.Object; e: AxEXToolBarLib._IToolBarEvents_DblClickEvent);
begin
end;

begin event DblClick(integer  Shift,long  X,long  Y)

end event DblClick

Private Sub DblClick(ByVal sender As System.Object, ByVal e As AxEXToolBarLib._IToolBarEvents_DblClickEvent) Handles DblClick
End Sub

Private Sub DblClick(Shift As Integer,X As Single,Y As Single)
End Sub

Private Sub DblClick(ByVal Shift As Integer,ByVal X As Long,ByVal Y As Long)
End Sub

LPARAMETERS Shift,X,Y

PROCEDURE OnDblClick(oToolBar,Shift,X,Y)

RETURN

Syntax for DblClick event, /COM version (others), on:

<SCRIPT EVENT="DblClick(Shift,X,Y)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function DblClick(Shift,X,Y)
End Function
</SCRIPT>

Procedure OnComDblClick Short   llShift OLE_XPOS_PIXELS   llX OLE_YPOS_PIXELS   llY
    Forward Send OnComDblClick llShift llX llY
End_Procedure

METHOD OCX_DblClick(Shift,X,Y) CLASS MainDialog
RETURN NIL

void onEvent_DblClick(int   _Shift,int   _X,int   _Y)
{
}

function DblClick as v (Shift  as  N,X  as  OLE::Exontrol.ToolBar.1::OLE_XPOS_PIXELS,Y  as  OLE::Exontrol.ToolBar.1::OLE_YPOS_PIXELS)
end function

function nativeObject_DblClick(Shift,X,Y)
return


event EditChange

event EditChange (Itm as Item)
Occurs when the user alters the item's text box/editor field.

Type | Description
Itm as Item | An Item object that contains a editor inside.
The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The EditChange event notifies your application once the user alters the item's editor value. The EditCaption property specifies the caption of the editor being altered. Use the AllowEdit property to add a editor inside the item, so the user can type any characters inside. The EditWidth property specifies the width of the editor inside the item. The EditBorder property specifies the border to be shown around the item's text box. You can use the Get method to collect all items of Edit type. In C++ or VFP, you can use the Notifier to get notified through the WM_COMMAND message.

Syntax for EditChange event, /NET version, on:

private void EditChange(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
}

Private Sub EditChange(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles EditChange
End Sub

Syntax for EditChange event, /COM version, on:

private void EditChange(object sender, AxEXTOOLBARLib._IToolBarEvents_EditChangeEvent e)
{
}

void OnEditChange(LPDISPATCH Itm)
{
}

void __fastcall EditChange(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
}

procedure EditChange(ASender: TObject; Itm : IItem);
begin
end;

procedure EditChange(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_EditChangeEvent);
begin
end;

begin event EditChange(oleobject Itm)
end event EditChange

Private Sub EditChange(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_EditChangeEvent) Handles EditChange
End Sub

Private Sub EditChange(ByVal Itm As EXTOOLBARLibCtl.IItem)
End Sub

Private Sub EditChange(ByVal Itm As Object)
End Sub

LPARAMETERS Itm

PROCEDURE OnEditChange(oToolBar,Itm)
RETURN

Syntax for EditChange event, /COM version (others), on:

<SCRIPT EVENT="EditChange(Itm)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function EditChange(Itm)
End Function
</SCRIPT>

Procedure OnComEditChange Variant llItm
    Forward Send OnComEditChange llItm
End_Procedure

METHOD OCX_EditChange(Itm) CLASS MainDialog
RETURN NIL

void onEvent_EditChange(COM _Itm)
{
}

function EditChange as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
end function

function nativeObject_EditChange(Itm)
return

The following samples show how you can get notified once the user edits the field, or change the slider value:

VBA (MS Access, Excell...)

' EditChange event - Occurs when the user alters the item's text box field.
Private Sub ToolBar1_EditChange(ByVal Itm As Object)
    With ToolBar1
        Debug.Print( "EditChange event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        With .Add("Item")
            .AllowEdit = 3
            .EditWidth = 128
            .EditBorder = 0
            .EditValue = 25
        End With
    End With
    .Refresh
End With

VB6

' EditChange event - Occurs when the user alters the item's text box field.
Private Sub ToolBar1_EditChange(ByVal Itm As EXTOOLBARLibCtl.IItem)
    With ToolBar1
        Debug.Print( "EditChange event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        With .Add("Item")
            .AllowEdit = exItemEditSlider
            .EditWidth = 128
            .EditBorder = exEditBorderNone
            .EditValue = 25
        End With
    End With
    .Refresh
End With

VB.NET

' EditChange event - Occurs when the user alters the item's text box field.
Private Sub Extoolbar1_EditChange(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.EditChange
    With Extoolbar1
        Debug.Print( "EditChange event on Itm object" )
    End With
End Sub

With Extoolbar1
    With .Items
        With .Add("Item")
            .AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditWidth = 128
            .EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditValue = 25
        End With
    End With
    .Refresh()
End With

VB.NET for /COM

' EditChange event - Occurs when the user alters the item's text box field.
Private Sub AxToolBar1_EditChange(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_EditChangeEvent) Handles AxToolBar1.EditChange
    With AxToolBar1
        Debug.Print( "EditChange event on Itm object" )
    End With
End Sub

With AxToolBar1
    With .Items
        With .Add("Item")
            .AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditSlider
            .EditWidth = 128
            .EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone
            .EditValue = 25
        End With
    End With
    .Refresh()
End With

C++

// EditChange event - Occurs when the user alters the item's text box field.
void OnEditChangeToolBar1(LPDISPATCH Itm)
{
    /*
        Copy and paste the following directives to your header file as
        it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'
        #import <ExToolBar.dll>
        using namespace EXTOOLBARLib;
    */
    EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
    OutputDebugStringW( L"EditChange event on Itm object" );
}

EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"Item",vtMissing,vtMissing);
        var_Item->PutAllowEdit(EXTOOLBARLib::exItemEditSlider);
        var_Item->PutEditWidth(128);
        var_Item->PutEditBorder(EXTOOLBARLib::exEditBorderNone);
        var_Item->PutEditValue(long(25));
spToolBar1->Refresh();

C++ Builder

// EditChange event - Occurs when the user alters the item's text box field.
void __fastcall TForm1::ToolBar1EditChange(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
    OutputDebugString( L"EditChange event on Itm object" );
}

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"Item",TNoParam(),TNoParam());
        var_Item->AllowEdit = Extoolbarlib_tlb::AllowEditEnum::exItemEditSlider;
        var_Item->EditWidth = 128;
        var_Item->EditBorder = Extoolbarlib_tlb::EditBorderEnum::exEditBorderNone;
        var_Item->set_EditValue(TVariant(25));
ToolBar1->Refresh();

C#

// EditChange event - Occurs when the user alters the item's text box field.
private void extoolbar1_EditChange(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
    System.Diagnostics.Debug.Print( "EditChange event on Itm object" );
}
//this.extoolbar1.EditChange += new exontrol.EXTOOLBARLib.exg2antt.EditChangeEventHandler(this.extoolbar1_EditChange);

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("Item",null,null);
        var_Item.AllowEdit = exontrol.EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item.EditWidth = 128;
        var_Item.EditBorder = exontrol.EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item.EditValue = 25;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<SCRIPT FOR="ToolBar1" EVENT="EditChange(Itm)" LANGUAGE="JScript">
    alert( "EditChange event on Itm object" );
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var var_Item = var_Items.Add("Item",null,null);
            var_Item.AllowEdit = 3;
            var_Item.EditWidth = 128;
            var_Item.EditBorder = 0;
            var_Item.EditValue = 25;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<SCRIPT LANGUAGE="VBScript">
Function ToolBar1_EditChange(Itm)
    With ToolBar1
        alert( "EditChange event on Itm object" )
    End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            With .Add("Item")
                .AllowEdit = 3
                .EditWidth = 128
                .EditBorder = 0
                .EditValue = 25
            End With
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// EditChange event - Occurs when the user alters the item's text box field.
private void axToolBar1_EditChange(object sender, AxEXTOOLBARLib._IToolBarEvents_EditChangeEvent e)
{
    System.Diagnostics.Debug.Print( "EditChange event on Itm object" );
}
//this.axToolBar1.EditChange += new AxEXTOOLBARLib._IToolBarEvents_EditChangeEventHandler(this.axToolBar1_EditChange);

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    EXTOOLBARLib.Item var_Item = var_Items.Add("Item",null,null);
        var_Item.AllowEdit = EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
        var_Item.EditWidth = 128;
        var_Item.EditBorder = EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
        var_Item.EditValue = 25;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

// EditChange event - Occurs when the user alters the item's text box field.
void onEvent_EditChange(COM _Itm)
{
    ;
    print( "EditChange event on Itm object" );
}

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = com_Items.Add("Item"); com_Item = var_Item;
            com_Item.AllowEdit(3/*exItemEditSlider*/);
            com_Item.EditWidth(128);
            com_Item.EditBorder(0/*exEditBorderNone*/);
            com_Item.EditValue(COMVariant::createFromInt(25));
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

// EditChange event - Occurs when the user alters the item's text box field.
procedure TWinForm1.AxToolBar1_EditChange(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_EditChangeEvent);
begin
    with AxToolBar1 do
    begin
        OutputDebugString( 'EditChange event on Itm object' );
    end
end;

with AxToolBar1 do
begin
    with Items do
    begin
        with Add('Item',Nil,Nil) do
        begin
            AllowEdit := EXTOOLBARLib.AllowEditEnum.exItemEditSlider;
            EditWidth := 128;
            EditBorder := EXTOOLBARLib.EditBorderEnum.exEditBorderNone;
            EditValue := TObject(25);
        end;
    end;
    Refresh();
end

Delphi (standard)

// EditChange event - Occurs when the user alters the item's text box field.
procedure TForm1.ToolBar1EditChange(ASender: TObject; Itm : IItem);
begin
    with ToolBar1 do
    begin
        OutputDebugString( 'EditChange event on Itm object' );
    end
end;

with ToolBar1 do
begin
    with Items do
    begin
        with Add('Item',Null,Null) do
        begin
            AllowEdit := EXTOOLBARLib_TLB.exItemEditSlider;
            EditWidth := 128;
            EditBorder := EXTOOLBARLib_TLB.exEditBorderNone;
            EditValue := OleVariant(25);
        end;
    end;
    Refresh();
end

VFP

*** EditChange event - Occurs when the user alters the item's text box field. ***
LPARAMETERS Itm
    with thisform.ToolBar1
        DEBUGOUT( "EditChange event on Itm object" )
    endwith

with thisform.ToolBar1
    with .Items
        with .Add("Item")
            .AllowEdit = 3
            .EditWidth = 128
            .EditBorder = 0
            .EditValue = 25
        endwith
    endwith
    .Refresh
endwith

dBASE Plus

/*
with (this.ACTIVEX1.nativeObject)
    EditChange = class::nativeObject_EditChange
endwith
*/
// Occurs when the user alters the item's text box field.
function nativeObject_EditChange(Itm)
    local oToolBar
    oToolBar = form.Activex1.nativeObject
    ? "EditChange event on Itm object"
return

local oToolBar,var_Item,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Item")
        var_Item.AllowEdit = 3
        var_Item.EditWidth = 128
        var_Item.EditBorder = 0
        var_Item.EditValue = 25
oToolBar.Refresh()

XBasic (Alpha Five)

' Occurs when the user alters the item's text box field.
function EditChange as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
    Dim oToolBar as P
    oToolBar = topparent:CONTROL_ACTIVEX1.activex
    ? "EditChange event on Itm object"
end function

Dim oToolBar as P
Dim var_Item as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Item")
        var_Item.AllowEdit = 3
        var_Item.EditWidth = 128
        var_Item.EditBorder = 0
        var_Item.EditValue = 25
oToolBar.Refresh()

Visual Objects

METHOD OCX_Exontrol1EditChange(Itm) CLASS MainDialog
    // EditChange event - Occurs when the user alters the item's text box field.
    OutputDebugString(String2Psz( "EditChange event on Itm object" ))
RETURN NIL

local var_Item as IItem
local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Item := var_Items:Add("Item",nil,nil)
        var_Item:AllowEdit := exItemEditSlider
        var_Item:EditWidth := 128
        var_Item:EditBorder := exEditBorderNone
        var_Item:EditValue := 25
oDCOCX_Exontrol1:Refresh()

PowerBuilder

/*begin event EditChange(oleobject Itm) - Occurs when the user alters the item's text box field.*/
/*
    OleObject oToolBar
    oToolBar = ole_1.Object
    MessageBox("Information",string( "EditChange event on Itm object" ))
*/
/*end event EditChange*/

OleObject oToolBar,var_Item,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Item = var_Items.Add("Item")
        var_Item.AllowEdit = 3
        var_Item.EditWidth = 128
        var_Item.EditBorder = 0
        var_Item.EditValue = 25
oToolBar.Refresh()

Visual DataFlex

// Occurs when the user alters the item's text box field.
Procedure OnComEditChange Variant llItm
    Forward Send OnComEditChange llItm
    Showln "EditChange event on Itm object"
End_Procedure

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComAllowEdit of hoItem to OLEexItemEditSlider
            Set ComEditWidth of hoItem to 128
            Set ComEditBorder of hoItem to OLEexEditBorderNone
            Set ComEditValue of hoItem to 25
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

PROCEDURE OnEditChange(oToolBar,Itm)
    DevOut( "EditChange event on Itm object" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItem
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:EditChange := {|Itm| OnEditChange(oToolBar,Itm)} /*Occurs when the user alters the item's text box field.*/

        oItems := oToolBar:Items()
            oItem := oItems:Add("Item")
                oItem:AllowEdit := 3/*exItemEditSlider*/
                oItem:EditWidth := 128
                oItem:EditBorder := 0/*exEditBorderNone*/
                oItem:EditValue := 25
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


event Event

event Event (EventID as Long)
Notifies the application once the control fires an event.

Type | Description
EventID as Long | A Long expression that specifies the identifier of the event. Each internal event of the control has an unique identifier. Use the EventParam(-2) to display entire information about fired event ( such as name, identifier, and properties ). The EventParam(-1) retrieves the number of parameters of fired event
The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The Event notification occurs ANY time the control fires an event. This is useful for X++, which does not support event with parameters passed by reference. Also, this could be useful for C++ Builder or Delphi, which does not handle properly the events with parameters of VARIANT type.

In X++ the "Error executing code: FormActiveXControl (data source), method ... called with invalid parameters" occurs when handling events that have parameters passed by reference. Passed by reference, means that in the event handler, you can change the value for that parameter, and so the control will takes the new value, and use it. The X++ is NOT able to handle properly events with parameters by reference, so we have the solution.

The solution is using and handling the Event notification and EventParam method., instead handling the event that gives the "invalid parameters" error executing code.

If you are not familiar with what a type library means just handle the Event of the control as follows:

// Notifies the application once the control fires an event.
void onEvent_Event(int _EventID)
{
    print extoolbar1.EventParam(-2).toString();
}

This code allows you to display the information for each event of the control being fired as in the list bellow:

"MouseMove/-606( 1 , 0 , 145 , 36 )" VT_BSTR
"BeforeDrawPart/54( 2 , -1962866148 , =0 , =0 , =0 , =0 , =false )" VT_BSTR
"AfterDrawPart/55( 2 , -1962866148 , 0 , 0 , 0 , 0 )" VT_BSTR
"MouseMove/-606( 1 , 0 , 145 , 35 )" VT_BSTR

Each line indicates an event, and the following information is provided: the name of the event, its identifier, and the list of parameters being passed to the event. The parameters that starts with = character, indicates a parameter by reference, in other words one that can changed during the event handler.

In conclusion, anytime the X++ fires the "invalid parameters." while handling an event, you can use and handle the Event notification and EventParam methods of the control

Syntax for Event event, /NET version, on:

private void Event(object sender,int EventID)
{
}

Private Sub Event(ByVal sender As System.Object,ByVal EventID As Integer) Handles Event
End Sub

Syntax for Event event, /COM version, on:

private void Event(object sender, AxEXTOOLBARLib._IToolBarEvents_EventEvent e)
{
}

void OnEvent(long EventID)
{
}

void __fastcall Event(TObject *Sender,long EventID)
{
}

procedure Event(ASender: TObject; EventID : Integer);
begin
end;

procedure Event(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_EventEvent);
begin
end;

begin event Event(long EventID)
end event Event

Private Sub Event(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_EventEvent) Handles Event
End Sub

Private Sub Event(ByVal EventID As Long)
End Sub

Private Sub Event(ByVal EventID As Long)
End Sub

LPARAMETERS EventID

PROCEDURE OnEvent(oToolBar,EventID)
RETURN

Syntax for Event event, /COM version (others), on:

<SCRIPT EVENT="Event(EventID)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function Event(EventID)
End Function
</SCRIPT>

Procedure OnComEvent Integer llEventID
    Forward Send OnComEvent llEventID
End_Procedure

METHOD OCX_Event(EventID) CLASS MainDialog
RETURN NIL

void onEvent_Event(int _EventID)
{
}

function Event as v (EventID as N)
end function

function nativeObject_Event(EventID)
return


event MouseDown

event MouseDown (Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user presses a mouse button.

Type | Description
Button as Integer | An integer that identifies the button that was pressed to cause the event
Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the button argument is pressed or released.
X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The X value is always expressed in container coordinates.
Y as OLE_YPOS_PIXELS | A single that specifies the current Y location of the mouse pointer. The Y value is always expressed in container coordinates.
Use a MouseDown or MouseUp event procedure to specify actions that will occur when a mouse button is pressed or released. Unlike the Click and DblClick events, MouseDown and MouseUp events lets you distinguish between the left, right, and middle mouse buttons. You can also write code for mouse-keyboard combinations that use the SHIFT, CTRL, and ALT keyboard modifiers. The ItemFromPoint(-1,-1) property gets the item from the cursor.

Syntax for MouseDown event, /NET version, on:

private void MouseDownEvent(object sender,short   Button,short   Shift,int   X,int   Y)
{
}

Private Sub MouseDownEvent(ByVal sender As System.Object,ByVal Button As Short,ByVal Shift As Short,ByVal X As Integer,ByVal Y As Integer) Handles MouseDownEvent
End Sub

Syntax for MouseDown event, /COM version, on:

private void MouseDownEvent(object sender, AxEXToolBarLib._IToolBarEvents_MouseDownEvent e)
{
}

void OnMouseDown(short   Button,short   Shift,long   X,long   Y)
{
}

void __fastcall MouseDown(TObject *Sender,short   Button,short   Shift,int   X,int   Y)
{
}

procedure MouseDown(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
end;

procedure MouseDownEvent(sender: System.Object; e: AxEXToolBarLib._IToolBarEvents_MouseDownEvent);
begin
end;

begin event MouseDown(integer  Button,integer  Shift,long  X,long  Y)

end event MouseDown

Private Sub MouseDownEvent(ByVal sender As System.Object, ByVal e As AxEXToolBarLib._IToolBarEvents_MouseDownEvent) Handles MouseDownEvent
End Sub

Private Sub MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub

Private Sub MouseDown(ByVal Button As Integer,ByVal Shift As Integer,ByVal X As Long,ByVal Y As Long)
End Sub

LPARAMETERS Button,Shift,X,Y

PROCEDURE OnMouseDown(oToolBar,Button,Shift,X,Y)

RETURN

Syntax for MouseDown event, /COM version (others), on:

<SCRIPT EVENT="MouseDown(Button,Shift,X,Y)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function MouseDown(Button,Shift,X,Y)
End Function
</SCRIPT>

Procedure OnComMouseDown Short   llButton Short   llShift OLE_XPOS_PIXELS   llX OLE_YPOS_PIXELS   llY
    Forward Send OnComMouseDown llButton llShift llX llY
End_Procedure

METHOD OCX_MouseDown(Button,Shift,X,Y) CLASS MainDialog
RETURN NIL

void onEvent_MouseDown(int   _Button,int   _Shift,int   _X,int   _Y)
{
}

function MouseDown as v (Button  as  N,Shift  as  N,X  as  OLE::Exontrol.ToolBar.1::OLE_XPOS_PIXELS,Y  as  OLE::Exontrol.ToolBar.1::OLE_YPOS_PIXELS)
end function

function nativeObject_MouseDown(Button,Shift,X,Y)
return


event MouseMove

event MouseMove (Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user moves the mouse.

Type | Description
Button as Integer | An integer that corresponds to the state of the mouse buttons in which a bit is set if the button is down. Gets which mouse button was pressed as 1 for Left Mouse Button, 2 for Right Mouse Button and 4 for Middle Mouse Button.
Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys.
X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in container coordinates.
Y as OLE_YPOS_PIXELS | A single that specifies the current Y location of the mouse pointer. The y values is always expressed in container coordinates.
The MouseMove event is generated continually as the mouse pointer moves across objects. Unless another object has captured the mouse, an object recognizes a MouseMove event whenever the mouse position is within its borders. The ItemFromPoint(-1,-1) property gets the item from the cursor.

Syntax for MouseMove event, /NET version, on:

private void MouseMoveEvent(object sender,short   Button,short   Shift,int   X,int   Y)
{
}

Private Sub MouseMoveEvent(ByVal sender As System.Object,ByVal Button As Short,ByVal Shift As Short,ByVal X As Integer,ByVal Y As Integer) Handles MouseMoveEvent
End Sub

Syntax for MouseMove event, /COM version, on:

private void MouseMoveEvent(object sender, AxEXToolBarLib._IToolBarEvents_MouseMoveEvent e)
{
}

void OnMouseMove(short   Button,short   Shift,long   X,long   Y)
{
}

void __fastcall MouseMove(TObject *Sender,short   Button,short   Shift,int   X,int   Y)
{
}

procedure MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
end;

procedure MouseMoveEvent(sender: System.Object; e: AxEXToolBarLib._IToolBarEvents_MouseMoveEvent);
begin
end;

begin event MouseMove(integer  Button,integer  Shift,long  X,long  Y)

end event MouseMove

Private Sub MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxEXToolBarLib._IToolBarEvents_MouseMoveEvent) Handles MouseMoveEvent
End Sub

Private Sub MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub

Private Sub MouseMove(ByVal Button As Integer,ByVal Shift As Integer,ByVal X As Long,ByVal Y As Long)
End Sub

LPARAMETERS Button,Shift,X,Y

PROCEDURE OnMouseMove(oToolBar,Button,Shift,X,Y)

RETURN

Syntax for MouseMove event, /COM version (others), on:

<SCRIPT EVENT="MouseMove(Button,Shift,X,Y)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function MouseMove(Button,Shift,X,Y)
End Function
</SCRIPT>

Procedure OnComMouseMove Short   llButton Short   llShift OLE_XPOS_PIXELS   llX OLE_YPOS_PIXELS   llY
    Forward Send OnComMouseMove llButton llShift llX llY
End_Procedure

METHOD OCX_MouseMove(Button,Shift,X,Y) CLASS MainDialog
RETURN NIL

void onEvent_MouseMove(int   _Button,int   _Shift,int   _X,int   _Y)
{
}

function MouseMove as v (Button  as  N,Shift  as  N,X  as  OLE::Exontrol.ToolBar.1::OLE_XPOS_PIXELS,Y  as  OLE::Exontrol.ToolBar.1::OLE_YPOS_PIXELS)
end function

function nativeObject_MouseMove(Button,Shift,X,Y)
return


event MouseUp

event MouseUp (Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user releases a mouse button.

Type | Description
Button as Integer | An integer that identifies the button that was pressed to cause the event.
Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the button argument is pressed or released.
X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in container coordinates.
Y as OLE_YPOS_PIXELS | A single that specifies the current Y location of the mouse pointer. The y values is always expressed in container coordinates.
Use a MouseDown or MouseUp event procedure to specify actions that will occur when a mouse button is pressed or released. Unlike the Click and DblClick events, MouseDown and MouseUp events lets you distinguish between the left, right, and middle mouse buttons. You can also write code for mouse-keyboard combinations that use the SHIFT, CTRL, and ALT keyboard modifiers. The ItemFromPoint(-1,-1) property gets the item from the cursor.

Syntax for MouseUp event, /NET version, on:

private void MouseUpEvent(object sender,short   Button,short   Shift,int   X,int   Y)
{
}

Private Sub MouseUpEvent(ByVal sender As System.Object,ByVal Button As Short,ByVal Shift As Short,ByVal X As Integer,ByVal Y As Integer) Handles MouseUpEvent
End Sub

Syntax for MouseUp event, /COM version, on:

private void MouseUpEvent(object sender, AxEXToolBarLib._IToolBarEvents_MouseUpEvent e)
{
}

void OnMouseUp(short   Button,short   Shift,long   X,long   Y)
{
}

void __fastcall MouseUp(TObject *Sender,short   Button,short   Shift,int   X,int   Y)
{
}

procedure MouseUp(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
end;

procedure MouseUpEvent(sender: System.Object; e: AxEXToolBarLib._IToolBarEvents_MouseUpEvent);
begin
end;

begin event MouseUp(integer  Button,integer  Shift,long  X,long  Y)

end event MouseUp

Private Sub MouseUpEvent(ByVal sender As System.Object, ByVal e As AxEXToolBarLib._IToolBarEvents_MouseUpEvent) Handles MouseUpEvent
End Sub

Private Sub MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub

Private Sub MouseUp(ByVal Button As Integer,ByVal Shift As Integer,ByVal X As Long,ByVal Y As Long)
End Sub

LPARAMETERS Button,Shift,X,Y

PROCEDURE OnMouseUp(oToolBar,Button,Shift,X,Y)

RETURN

Syntax for MouseUp event, /COM version (others), on:

<SCRIPT EVENT="MouseUp(Button,Shift,X,Y)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function MouseUp(Button,Shift,X,Y)
End Function
</SCRIPT>

Procedure OnComMouseUp Short   llButton Short   llShift OLE_XPOS_PIXELS   llX OLE_YPOS_PIXELS   llY
    Forward Send OnComMouseUp llButton llShift llX llY
End_Procedure

METHOD OCX_MouseUp(Button,Shift,X,Y) CLASS MainDialog
RETURN NIL

void onEvent_MouseUp(int   _Button,int   _Shift,int   _X,int   _Y)
{
}

function MouseUp as v (Button  as  N,Shift  as  N,X  as  OLE::Exontrol.ToolBar.1::OLE_XPOS_PIXELS,Y  as  OLE::Exontrol.ToolBar.1::OLE_YPOS_PIXELS)
end function

function nativeObject_MouseUp(Button,Shift,X,Y)
return


event OleEvent

event OleEvent (Itm as Item, Ev as OleEvent)
Occurs when an inside ActiveX control fires an event.

Type | Description
Itm as Item | An Item object that contains the sub-control.
Ev as OleEvent | An OleEvent object that holds information about the fired event.
The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The eXToolBar component may include sub-menus that displays any ActiveX / NET Component. The inside COM/ActiveX control fires its events through the ExToolBar's OleEvent event. Use the ItemTypeEnum.SubControl to add an item that hosts an ActiveX inside. Use the SubControl property to access the properties to create the inside ActiveX control.

The following screen shot displays an item with an ExCalendar inside:

Syntax for OleEvent event, /NET version, on:

private void OleEvent(object sender,exontrol.EXTOOLBARLib.Item Itm,exontrol.EXTOOLBARLib.OleEvent Ev)
{
}

Private Sub OleEvent(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item,ByVal Ev As exontrol.EXTOOLBARLib.OleEvent) Handles OleEvent
End Sub

Syntax for OleEvent event, /COM version, on:

private void OleEvent(object sender, AxEXTOOLBARLib._IToolBarEvents_OleEventEvent e)
{
}

void OnOleEvent(LPDISPATCH Itm,LPDISPATCH Ev)
{
}

void __fastcall OleEvent(TObject *Sender,Extoolbarlib_tlb::IItem *Itm,Extoolbarlib_tlb::IOleEvent *Ev)
{
}

procedure OleEvent(ASender: TObject; Itm : IItem;Ev : IOleEvent);
begin
end;

procedure OleEvent(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_OleEventEvent);
begin
end;

begin event OleEvent(oleobject Itm,oleobject Ev)
end event OleEvent

Private Sub OleEvent(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_OleEventEvent) Handles OleEvent
End Sub

Private Sub OleEvent(ByVal Itm As EXTOOLBARLibCtl.IItem,ByVal Ev As EXTOOLBARLibCtl.IOleEvent)
End Sub

Private Sub OleEvent(ByVal Itm As Object,ByVal Ev As Object)
End Sub

LPARAMETERS Itm,Ev

PROCEDURE OnOleEvent(oToolBar,Itm,Ev)
RETURN

Syntax for OleEvent event, /COM version (others), on:

<SCRIPT EVENT="OleEvent(Itm,Ev)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function OleEvent(Itm,Ev)
End Function
</SCRIPT>

Procedure OnComOleEvent Variant llItm Variant llEv
    Forward Send OnComOleEvent llItm llEv
End_Procedure

METHOD OCX_OleEvent(Itm,Ev) CLASS MainDialog
RETURN NIL

void onEvent_OleEvent(COM _Itm,COM _Ev)
{
}

function OleEvent as v (Itm as OLE::Exontrol.ToolBar.1::IItem,Ev as OLE::Exontrol.ToolBar.1::IOleEvent)
end function

function nativeObject_OleEvent(Itm,Ev)
return

The following samples shows how to load an ActiveX control ( Exontrol.Calendar )

VBA (MS Access, Excell...)

With ToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    End With
    .Refresh
End With

VB6

With ToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    End With
    .Refresh
End With

VB.NET

With Extoolbar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create()
    End With
    .Refresh()
End With

VB.NET for /COM

With AxToolBar1
    With .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create()
    End With
    .Refresh()
End With

C++

/*
    Copy and paste the following directives to your header file as
    it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'

    #import <ExToolBar.dll>
    using namespace EXTOOLBARLib;
*/
EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IControlPtr var_Control = spToolBar1->GetItems()->Add(L"Calendar",long(3),vtMissing)->GetSubControl();
    var_Control->PutWidth(256);
    var_Control->PutHeight(256);
    var_Control->PutControlID(L"Exontrol.Calendar");
    var_Control->Create();
spToolBar1->Refresh();

C++ Builder

Extoolbarlib_tlb::IControlPtr var_Control = ToolBar1->Items->Add(L"Calendar",TVariant(3),TNoParam())->SubControl;
    var_Control->Width = 256;
    var_Control->Height = 256;
    var_Control->ControlID = L"Exontrol.Calendar";
    var_Control->Create();
ToolBar1->Refresh();

C#

exontrol.EXTOOLBARLib.Control var_Control = extoolbar1.Items.Add("Calendar",3,null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 256;
    var_Control.ControlID = "Exontrol.Calendar";
    var_Control.Create();
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Control = ToolBar1.Items.Add("Calendar",3,null).SubControl;
        var_Control.Width = 256;
        var_Control.Height = 256;
        var_Control.ControlID = "Exontrol.Calendar";
        var_Control.Create();
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items.Add("Calendar",3).SubControl
            .Width = 256
            .Height = 256
            .ControlID = "Exontrol.Calendar"
            .Create
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXTOOLBARLib.Control var_Control = axToolBar1.Items.Add("Calendar",3,null).SubControl;
    var_Control.Width = 256;
    var_Control.Height = 256;
    var_Control.ControlID = "Exontrol.Calendar";
    var_Control.Create();
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

public void init()
{
    COM com_Control,com_Item;
    anytype var_Control,var_Item;
    ;

    super();

    var_Item = COM::createFromObject(extoolbar1.Items()).Add("Calendar",COMVariant::createFromInt(3)); com_Item = var_Item;
    var_Control = com_Item.SubControl(); com_Control = var_Control;
        com_Control.Width(256);
        com_Control.Height(256);
        com_Control.ControlID("Exontrol.Calendar");
        com_Control.Create();
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

with AxToolBar1 do
begin
    with Items.Add('Calendar',TObject(3),Nil).SubControl do
    begin
        Width := 256;
        Height := 256;
        ControlID := 'Exontrol.Calendar';
        Create();
    end;
    Refresh();
end

Delphi (standard)

with ToolBar1 do
begin
    with Items.Add('Calendar',OleVariant(3),Null).SubControl do
    begin
        Width := 256;
        Height := 256;
        ControlID := 'Exontrol.Calendar';
        Create();
    end;
    Refresh();
end

VFP

with thisform.ToolBar1
    with .Items.Add("Calendar",3).SubControl
        .Width = 256
        .Height = 256
        .ControlID = "Exontrol.Calendar"
        .Create
    endwith
    .Refresh
endwith

dBASE Plus

local oToolBar,var_Control

oToolBar = form.Activex1.nativeObject
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

XBasic (Alpha Five)

Dim oToolBar as P
Dim var_Control as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

Visual Objects

local var_Control as IControl

var_Control := oDCOCX_Exontrol1:Items:Add("Calendar",3,nil):SubControl
    var_Control:Width := 256
    var_Control:Height := 256
    var_Control:ControlID := "Exontrol.Calendar"
    var_Control:Create()
oDCOCX_Exontrol1:Refresh()

PowerBuilder

OleObject oToolBar,var_Control

oToolBar = ole_1.Object
var_Control = oToolBar.Items.Add("Calendar",3).SubControl
    var_Control.Width = 256
    var_Control.Height = 256
    var_Control.ControlID = "Exontrol.Calendar"
    var_Control.Create()
oToolBar.Refresh()

Visual DataFlex

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Calendar" 3 Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Variant voControl
            Get ComSubControl of hoItem to voControl
            Handle hoControl
            Get Create (RefClass(cComControl)) to hoControl
            Set pvComObject of hoControl to voControl
                Set ComWidth of hoControl to 256
                Set ComHeight of hoControl to 256
                Set ComControlID of hoControl to "Exontrol.Calendar"
                Send ComCreate of hoControl
            Send Destroy to hoControl
        Send Destroy to hoItem
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oControl
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oControl := oToolBar:Items():Add("Calendar",3):SubControl()
            oControl:Width := 256
            oControl:Height := 256
            oControl:ControlID := "Exontrol.Calendar"
            oControl:Create()
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


event SelectItem

event SelectItem (Itm as Item)
Occurs when the user selects the item.

Type | Description
Itm as Item | An Item object being clicked.
The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The SelectItem event notifies your application once the user clicks/selects an item. The ID property specifies the item's identifier. In C++ or VFP, you can use the Notifier to get notified through the WM_COMMAND message.

Syntax for SelectItem event, /NET version, on:

private void SelectItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
}

Private Sub SelectItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles SelectItem
End Sub

Syntax for SelectItem event, /COM version, on:

private void SelectItem(object sender, AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent e)
{
}

void OnSelectItem(LPDISPATCH Itm)
{
}

void __fastcall SelectItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
}

procedure SelectItem(ASender: TObject; Itm : IItem);
begin
end;

procedure SelectItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent);
begin
end;

begin event SelectItem(oleobject Itm)
end event SelectItem

Private Sub SelectItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent) Handles SelectItem
End Sub

Private Sub SelectItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
End Sub

Private Sub SelectItem(ByVal Itm As Object)
End Sub

LPARAMETERS Itm

PROCEDURE OnSelectItem(oToolBar,Itm)
RETURN

Syntax for SelectItem event, /COM version (others), on:

<SCRIPT EVENT="SelectItem(Itm)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function SelectItem(Itm)
End Function
</SCRIPT>

Procedure OnComSelectItem Variant llItm
    Forward Send OnComSelectItem llItm
End_Procedure

METHOD OCX_SelectItem(Itm) CLASS MainDialog
RETURN NIL

void onEvent_SelectItem(COM _Itm)
{
}

function SelectItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
end function

function nativeObject_SelectItem(Itm)
return

The following samples show how you can get notified once the user clicks the item:

VBA (MS Access, Excell...)

' SelectItem event - Occurs when the user selects the item.
Private Sub ToolBar1_SelectItem(ByVal Itm As Object)
    With ToolBar1
        Debug.Print( "SelectItem event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        .Add "Item"
        .Add "Item"
    End With
    .Refresh
End With

VB6

' SelectItem event - Occurs when the user selects the item.
Private Sub ToolBar1_SelectItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
    With ToolBar1
        Debug.Print( "SelectItem event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        .Add "Item"
        .Add "Item"
    End With
    .Refresh
End With

VB.NET

' SelectItem event - Occurs when the user selects the item.
Private Sub Extoolbar1_SelectItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.SelectItem
    With Extoolbar1
        Debug.Print( "SelectItem event on Itm object" )
    End With
End Sub

With Extoolbar1
    With .Items
        .Add("Item")
        .Add("Item")
    End With
    .Refresh()
End With

VB.NET for /COM

' SelectItem event - Occurs when the user selects the item.
Private Sub AxToolBar1_SelectItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent) Handles AxToolBar1.SelectItem
    With AxToolBar1
        Debug.Print( "SelectItem event on Itm object" )
    End With
End Sub

With AxToolBar1
    With .Items
        .Add("Item")
        .Add("Item")
    End With
    .Refresh()
End With

C++

// SelectItem event - Occurs when the user selects the item.
void OnSelectItemToolBar1(LPDISPATCH Itm)
{
    /*
        Copy and paste the following directives to your header file as
        it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'
        #import <ExToolBar.dll>
        using namespace EXTOOLBARLib;
    */
    EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
    OutputDebugStringW( L"SelectItem event on Itm object" );
}

EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing);
    var_Items->Add(L"Item",vtMissing,vtMissing);
spToolBar1->Refresh();

C++ Builder

// SelectItem event - Occurs when the user selects the item.
void __fastcall TForm1::ToolBar1SelectItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
    OutputDebugString( L"SelectItem event on Itm object" );
}

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam());
    var_Items->Add(L"Item",TNoParam(),TNoParam());
ToolBar1->Refresh();

C#

// SelectItem event - Occurs when the user selects the item.
private void extoolbar1_SelectItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
    System.Diagnostics.Debug.Print( "SelectItem event on Itm object" );
}
//this.extoolbar1.SelectItem += new exontrol.EXTOOLBARLib.exg2antt.SelectItemEventHandler(this.extoolbar1_SelectItem);

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null);
    var_Items.Add("Item",null,null);
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<SCRIPT FOR="ToolBar1" EVENT="SelectItem(Itm)" LANGUAGE="JScript">
    alert( "SelectItem event on Itm object" );
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null);
        var_Items.Add("Item",null,null);
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<SCRIPT LANGUAGE="VBScript">
Function ToolBar1_SelectItem(Itm)
    With ToolBar1
        alert( "SelectItem event on Itm object" )
    End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add "Item"
            .Add "Item"
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// SelectItem event - Occurs when the user selects the item.
private void axToolBar1_SelectItem(object sender, AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent e)
{
    System.Diagnostics.Debug.Print( "SelectItem event on Itm object" );
}
//this.axToolBar1.SelectItem += new AxEXTOOLBARLib._IToolBarEvents_SelectItemEventHandler(this.axToolBar1_SelectItem);

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null);
    var_Items.Add("Item",null,null);
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

// SelectItem event - Occurs when the user selects the item.
void onEvent_SelectItem(COM _Itm)
{
    ;
    print( "SelectItem event on Itm object" );
}

public void init()
{
    COM com_Items;
    anytype var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        com_Items.Add("Item");
        com_Items.Add("Item");
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

// SelectItem event - Occurs when the user selects the item.
procedure TWinForm1.AxToolBar1_SelectItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_SelectItemEvent);
begin
    with AxToolBar1 do
    begin
        OutputDebugString( 'SelectItem event on Itm object' );
    end
end;

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil);
        Add('Item',Nil,Nil);
    end;
    Refresh();
end

Delphi (standard)

// SelectItem event - Occurs when the user selects the item.
procedure TForm1.ToolBar1SelectItem(ASender: TObject; Itm : IItem);
begin
    with ToolBar1 do
    begin
        OutputDebugString( 'SelectItem event on Itm object' );
    end
end;

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null);
        Add('Item',Null,Null);
    end;
    Refresh();
end

VFP

*** SelectItem event - Occurs when the user selects the item. ***
LPARAMETERS Itm
    with thisform.ToolBar1
        DEBUGOUT( "SelectItem event on Itm object" )
    endwith

with thisform.ToolBar1
    with .Items
        .Add("Item")
        .Add("Item")
    endwith
    .Refresh
endwith

dBASE Plus

/*
with (this.ACTIVEX1.nativeObject)
    SelectItem = class::nativeObject_SelectItem
endwith
*/
// Occurs when the user selects the item.
function nativeObject_SelectItem(Itm)
    local oToolBar
    oToolBar = form.Activex1.nativeObject
    ? "SelectItem event on Itm object"
return

local oToolBar,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    var_Items.Add("Item")
    var_Items.Add("Item")
oToolBar.Refresh()

XBasic (Alpha Five)

' Occurs when the user selects the item.
function SelectItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
    Dim oToolBar as P
    oToolBar = topparent:CONTROL_ACTIVEX1.activex
    ? "SelectItem event on Itm object"
end function

Dim oToolBar as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    var_Items.Add("Item")
    var_Items.Add("Item")
oToolBar.Refresh()

Visual Objects

METHOD OCX_Exontrol1SelectItem(Itm) CLASS MainDialog
    // SelectItem event - Occurs when the user selects the item.
    OutputDebugString(String2Psz( "SelectItem event on Itm object" ))
RETURN NIL

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil)
    var_Items:Add("Item",nil,nil)
oDCOCX_Exontrol1:Refresh()

PowerBuilder

/*begin event SelectItem(oleobject Itm) - Occurs when the user selects the item.*/
/*
    OleObject oToolBar
    oToolBar = ole_1.Object
    MessageBox("Information",string( "SelectItem event on Itm object" ))
*/
/*end event SelectItem*/

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item")
    var_Items.Add("Item")
oToolBar.Refresh()

Visual DataFlex

// Occurs when the user selects the item.
Procedure OnComSelectItem Variant llItm
    Forward Send OnComSelectItem llItm
    Showln "SelectItem event on Itm object"
End_Procedure

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Get ComAdd of hoItems "Item" Nothing Nothing to Nothing
        Get ComAdd of hoItems "Item" Nothing Nothing to Nothing
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

PROCEDURE OnSelectItem(oToolBar,Itm)
    DevOut( "SelectItem event on Itm object" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:SelectItem := {|Itm| OnSelectItem(oToolBar,Itm)} /*Occurs when the user selects the item.*/

        oItems := oToolBar:Items()
            oItems:Add("Item")
            oItems:Add("Item")
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


event UncheckItem

event UncheckItem (Itm as Item)
Occurs when the user unchecks the item.

Type | Description
Itm as Item | An Item object that indicates the item being un-checked.
The trial/evaluation version of the control limits firing this event. In other words, using the trial/evaluation version won't fire the event every time.

The UncheckItem event notifies your application once the user clicks the item's check-box. The Check property indicates whether the Item has associated a check box. The Checked property specifies whether the item is checked or unchecked. Use the Radio property to display a radio-button on the item. In C++ or VFP, you can use the Notifier to get notified through the WM_COMMAND message. The Checked property specifies whether the item is checked or unchecked. The CheckedItem event notifies once the user checks the item.

Syntax for UncheckItem event, /NET version, on:

private void UncheckItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
}

Private Sub UncheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles UncheckItem
End Sub

Syntax for UncheckItem event, /COM version, on:

private void UncheckItem(object sender, AxEXTOOLBARLib._IToolBarEvents_UncheckItemEvent e)
{
}

void OnUncheckItem(LPDISPATCH Itm)
{
}

void __fastcall UncheckItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
}

procedure UncheckItem(ASender: TObject; Itm : IItem);
begin
end;

procedure UncheckItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_UncheckItemEvent);
begin
end;

begin event UncheckItem(oleobject Itm)
end event UncheckItem

Private Sub UncheckItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_UncheckItemEvent) Handles UncheckItem
End Sub

Private Sub UncheckItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
End Sub

Private Sub UncheckItem(ByVal Itm As Object)
End Sub

LPARAMETERS Itm

PROCEDURE OnUncheckItem(oToolBar,Itm)
RETURN

Syntax for UncheckItem event, /COM version (others), on:

<SCRIPT EVENT="UncheckItem(Itm)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function UncheckItem(Itm)
End Function
</SCRIPT>

Procedure OnComUncheckItem Variant llItm
    Forward Send OnComUncheckItem llItm
End_Procedure

METHOD OCX_UncheckItem(Itm) CLASS MainDialog
RETURN NIL

void onEvent_UncheckItem(COM _Itm)
{
}

function UncheckItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
end function

function nativeObject_UncheckItem(Itm)
return

The following samples show how you can get notified once the user un-checks an item:

VBA (MS Access, Excell...)

' UncheckItem event - Occurs when the user unchecks the item.
Private Sub ToolBar1_UncheckItem(ByVal Itm As Object)
    With ToolBar1
        Debug.Print( "UncheckItem event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh
End With

VB6

' UncheckItem event - Occurs when the user unchecks the item.
Private Sub ToolBar1_UncheckItem(ByVal Itm As EXTOOLBARLibCtl.IItem)
    With ToolBar1
        Debug.Print( "UncheckItem event on Itm object" )
    End With
End Sub

With ToolBar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh
End With

VB.NET

' UncheckItem event - Occurs when the user unchecks the item.
Private Sub Extoolbar1_UncheckItem(ByVal sender As System.Object,ByVal Itm As exontrol.EXTOOLBARLib.Item) Handles Extoolbar1.UncheckItem
    With Extoolbar1
        Debug.Print( "UncheckItem event on Itm object" )
    End With
End Sub

With Extoolbar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh()
End With

VB.NET for /COM

' UncheckItem event - Occurs when the user unchecks the item.
Private Sub AxToolBar1_UncheckItem(ByVal sender As System.Object, ByVal e As AxEXTOOLBARLib._IToolBarEvents_UncheckItemEvent) Handles AxToolBar1.UncheckItem
    With AxToolBar1
        Debug.Print( "UncheckItem event on Itm object" )
    End With
End Sub

With AxToolBar1
    With .Items
        .Add("Item").Check = True
        .Add("Item").Check = True
    End With
    .Refresh()
End With

C++

// UncheckItem event - Occurs when the user unchecks the item.
void OnUncheckItemToolBar1(LPDISPATCH Itm)
{
    /*
        Copy and paste the following directives to your header file as
        it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library'
        #import <ExToolBar.dll>
        using namespace EXTOOLBARLib;
    */
    EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
    OutputDebugStringW( L"UncheckItem event on Itm object" );
}

EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown();
EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems();
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
    var_Items->Add(L"Item",vtMissing,vtMissing)->PutCheck(VARIANT_TRUE);
spToolBar1->Refresh();

C++ Builder

// UncheckItem event - Occurs when the user unchecks the item.
void __fastcall TForm1::ToolBar1UncheckItem(TObject *Sender,Extoolbarlib_tlb::IItem *Itm)
{
    OutputDebugString( L"UncheckItem event on Itm object" );
}

Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true;
    var_Items->Add(L"Item",TNoParam(),TNoParam())->Check = true;
ToolBar1->Refresh();

C#

// UncheckItem event - Occurs when the user unchecks the item.
private void extoolbar1_UncheckItem(object sender,exontrol.EXTOOLBARLib.Item Itm)
{
    System.Diagnostics.Debug.Print( "UncheckItem event on Itm object" );
}
//this.extoolbar1.UncheckItem += new exontrol.EXTOOLBARLib.exg2antt.UncheckItemEventHandler(this.extoolbar1_UncheckItem);

exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items;
    var_Items.Add("Item",null,null).Check = true;
    var_Items.Add("Item",null,null).Check = true;
extoolbar1.Refresh();

JScript/JavaScript

<BODY onload='Init()'>
<SCRIPT FOR="ToolBar1" EVENT="UncheckItem(Itm)" LANGUAGE="JScript">
    alert( "UncheckItem event on Itm object" );
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
    var var_Items = ToolBar1.Items;
        var_Items.Add("Item",null,null).Check = true;
        var_Items.Add("Item",null,null).Check = true;
    ToolBar1.Refresh();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload='Init()'>
<SCRIPT LANGUAGE="VBScript">
Function ToolBar1_UncheckItem(Itm)
    With ToolBar1
        alert( "UncheckItem event on Itm object" )
    End With
End Function
</SCRIPT>

<OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
    With ToolBar1
        With .Items
            .Add("Item").Check = True
            .Add("Item").Check = True
        End With
        .Refresh
    End With
End Function
</SCRIPT>
</BODY>

C# for /COM

// UncheckItem event - Occurs when the user unchecks the item.
private void axToolBar1_UncheckItem(object sender, AxEXTOOLBARLib._IToolBarEvents_UncheckItemEvent e)
{
    System.Diagnostics.Debug.Print( "UncheckItem event on Itm object" );
}
//this.axToolBar1.UncheckItem += new AxEXTOOLBARLib._IToolBarEvents_UncheckItemEventHandler(this.axToolBar1_UncheckItem);

EXTOOLBARLib.Items var_Items = axToolBar1.Items;
    var_Items.Add("Item",null,null).Check = true;
    var_Items.Add("Item",null,null).Check = true;
axToolBar1.Refresh();

X++ (Dynamics Ax 2009)

// UncheckItem event - Occurs when the user unchecks the item.
void onEvent_UncheckItem(COM _Itm)
{
    ;
    print( "UncheckItem event on Itm object" );
}

public void init()
{
    COM com_Item,com_Items;
    anytype var_Item,var_Items;
    ;

    super();

    var_Items = extoolbar1.Items(); com_Items = var_Items;
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Check(true);
        var_Item = COM::createFromObject(com_Items.Add("Item")); com_Item = var_Item;
        com_Item.Check(true);
    extoolbar1.Refresh();
}

Delphi 8 (.NET only)

// UncheckItem event - Occurs when the user unchecks the item.
procedure TWinForm1.AxToolBar1_UncheckItem(sender: System.Object; e: AxEXTOOLBARLib._IToolBarEvents_UncheckItemEvent);
begin
    with AxToolBar1 do
    begin
        OutputDebugString( 'UncheckItem event on Itm object' );
    end
end;

with AxToolBar1 do
begin
    with Items do
    begin
        Add('Item',Nil,Nil).Check := True;
        Add('Item',Nil,Nil).Check := True;
    end;
    Refresh();
end

Delphi (standard)

// UncheckItem event - Occurs when the user unchecks the item.
procedure TForm1.ToolBar1UncheckItem(ASender: TObject; Itm : IItem);
begin
    with ToolBar1 do
    begin
        OutputDebugString( 'UncheckItem event on Itm object' );
    end
end;

with ToolBar1 do
begin
    with Items do
    begin
        Add('Item',Null,Null).Check := True;
        Add('Item',Null,Null).Check := True;
    end;
    Refresh();
end

VFP

*** UncheckItem event - Occurs when the user unchecks the item. ***
LPARAMETERS Itm
    with thisform.ToolBar1
        DEBUGOUT( "UncheckItem event on Itm object" )
    endwith

with thisform.ToolBar1
    with .Items
        .Add("Item").Check = .T.
        .Add("Item").Check = .T.
    endwith
    .Refresh
endwith

dBASE Plus

/*
with (this.ACTIVEX1.nativeObject)
    UncheckItem = class::nativeObject_UncheckItem
endwith
*/
// Occurs when the user unchecks the item.
function nativeObject_UncheckItem(Itm)
    local oToolBar
    oToolBar = form.Activex1.nativeObject
    ? "UncheckItem event on Itm object"
return

local oToolBar,var_Item,var_Item1,var_Items

oToolBar = form.Activex1.nativeObject
var_Items = oToolBar.Items
    // var_Items.Add("Item").Check = true
    var_Item = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item]
        TemplateDef = var_Item
        Template = [var_Item.Check = true]
    endwith
    // var_Items.Add("Item").Check = true
    var_Item1 = var_Items.Add("Item")
    with (oToolBar)
        TemplateDef = [Dim var_Item1]
        TemplateDef = var_Item1
        Template = [var_Item1.Check = true]
    endwith
oToolBar.Refresh()

XBasic (Alpha Five)

' Occurs when the user unchecks the item.
function UncheckItem as v (Itm as OLE::Exontrol.ToolBar.1::IItem)
    Dim oToolBar as P
    oToolBar = topparent:CONTROL_ACTIVEX1.activex
    ? "UncheckItem event on Itm object"
end function

Dim oToolBar as P
Dim var_Item as P
Dim var_Item1 as P
Dim var_Items as P

oToolBar = topparent:CONTROL_ACTIVEX1.activex
var_Items = oToolBar.Items
    ' var_Items.Add("Item").Check = .t.
    var_Item = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item"
    oToolBar.TemplateDef = var_Item
    oToolBar.Template = "var_Item.Check = True"

    ' var_Items.Add("Item").Check = .t.
    var_Item1 = var_Items.Add("Item")
    oToolBar.TemplateDef = "Dim var_Item1"
    oToolBar.TemplateDef = var_Item1
    oToolBar.Template = "var_Item1.Check = True"

oToolBar.Refresh()

Visual Objects

METHOD OCX_Exontrol1UncheckItem(Itm) CLASS MainDialog
    // UncheckItem event - Occurs when the user unchecks the item.
    OutputDebugString(String2Psz( "UncheckItem event on Itm object" ))
RETURN NIL

local var_Items as IItems

var_Items := oDCOCX_Exontrol1:Items
    var_Items:Add("Item",nil,nil):Check := true
    var_Items:Add("Item",nil,nil):Check := true
oDCOCX_Exontrol1:Refresh()

PowerBuilder

/*begin event UncheckItem(oleobject Itm) - Occurs when the user unchecks the item.*/
/*
    OleObject oToolBar
    oToolBar = ole_1.Object
    MessageBox("Information",string( "UncheckItem event on Itm object" ))
*/
/*end event UncheckItem*/

OleObject oToolBar,var_Items

oToolBar = ole_1.Object
var_Items = oToolBar.Items
    var_Items.Add("Item").Check = true
    var_Items.Add("Item").Check = true
oToolBar.Refresh()

Visual DataFlex

// Occurs when the user unchecks the item.
Procedure OnComUncheckItem Variant llItm
    Forward Send OnComUncheckItem llItm
    Showln "UncheckItem event on Itm object"
End_Procedure

Procedure OnCreate
    Forward Send OnCreate
    Variant voItems
    Get ComItems to voItems
    Handle hoItems
    Get Create (RefClass(cComItems)) to hoItems
    Set pvComObject of hoItems to voItems
        Variant voItem
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem
        Handle hoItem
        Get Create (RefClass(cComItem)) to hoItem
        Set pvComObject of hoItem to voItem
            Set ComCheck of hoItem to True
        Send Destroy to hoItem
        Variant voItem1
        Get ComAdd of hoItems "Item" Nothing Nothing to voItem1
        Handle hoItem1
        Get Create (RefClass(cComItem)) to hoItem1
        Set pvComObject of hoItem1 to voItem1
            Set ComCheck of hoItem1 to True
        Send Destroy to hoItem1
    Send Destroy to hoItems
    Send ComRefresh
End_Procedure

XBase++

PROCEDURE OnUncheckItem(oToolBar,Itm)
    DevOut( "UncheckItem event on Itm object" )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
     LOCAL oForm
    LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
    LOCAL oItems
    LOCAL oToolBar

    oForm := XbpDialog():new( AppDesktop() )
    oForm:drawingArea:clipChildren := .T.
    oForm:create( ,,{100,100}, {640,480},, .F. )
    oForm:close  := {|| PostAppEvent( xbeP_Quit )}

    oToolBar := XbpActiveXControl():new( oForm:drawingArea )
    oToolBar:CLSID  := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/
    oToolBar:create(,, {10,60},{610,370} )

        oToolBar:UncheckItem := {|Itm| OnUncheckItem(oToolBar,Itm)} /*Occurs when the user unchecks the item.*/

        oItems := oToolBar:Items()
            oItems:Add("Item"):Check := .T.
            oItems:Add("Item"):Check := .T.
        oToolBar:Refresh()

    oForm:Show()
    DO WHILE nEvent != xbeP_Quit
        nEvent := AppEvent( @mp1, @mp2, @oXbp )
        oXbp:handleEvent( nEvent, mp1, mp2 )
    ENDDO
RETURN


Expressions

An expression is a string which defines a formula or criteria, that's evaluated at runtime. The expression may be a combination of variables, constants, strings, dates and operators/functions. For instance 1000 format `` gets 1,000.00 for US format, while 1.000,00 is displayed for German format.

The Exontrol's eXPression component is a syntax-editor that helps you to define, view, edit and evaluate expressions. Using the eXPression component you can easily view or check if the expression you have used is syntactically correct, and you can evaluate what is the result you get giving different values to be tested. The Exontrol's eXPression component can be used as an user-editor, to configure your applications.

Usage examples:

  • 100 + 200, adds numbers and returns 300
  • "100" + 200, concatenates the strings, and returns "100200"
  • currency(1000) displays the value in currency format based on the current regional setting, such as "$1,000.00" for US format.
  • 1000 format `` gets 1,000.00 for English format, while 1.000,00 is displayed for German format
  • 1000 format `2|.|3|,` always gets 1,000.00 no matter of settings in the control panel.
  • upper("string") converts the giving string in uppercase letters, such as "STRING"
  • date(dateS('3/1/' + year(9:=#1/1/2018#)) + ((1:=(((255 - 11 * (year(=:9) mod 19)) - 21) mod 30) + 21) + (=:1 > 48 ? -1 : 0) + 6 - ((year(=:9) + int(year(=:9) / 4)) + =:1 + (=:1 > 48 ? -1 : 0) + 1) mod 7)) returns the date the Easter Sunday will fall, for year 2018. In this case the expression returns #4/1/2018#. If #1/1/2018# is replaced with #1/1/2019#, the expression returns #4/21/2019#.

Listed bellow are all predefined constants, operators and functions the general-expression supports:

The constants can be represented as:

  • numbers in decimal format ( where dot character specifies the decimal separator ). For instance: -1, 100, 20.45, .99 and so on
  • numbers in hexa-decimal format ( preceded by 0x or 0X sequence ), uses sixteen distinct symbols, most often the symbols 0-9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a, b, c, d, e, f) to represent values ten to fifteen. Hexadecimal numerals are widely used by computer system designers and programmers. As each hexadecimal digit represents four binary digits (bits), it allows a more human-friendly representation of binary-coded values. For instance, 0xFF, 0x00FF00, and so so.
  • date-time in format #mm/dd/yyyy hh:mm:ss#, For instance, #1/31/2001 10:00# means the January 31th, 2001, 10:00 AM
  • string, if it starts / ends with any of the ' or ` or " characters. If you require the starting character inside the string, it should be escaped ( preceded by a \ character ). For instance, `Mihai`, "Filimon", 'has', "\"a quote\"", and so on

The predefined constants are:

  • bias ( BIAS constant), defines the difference, in minutes, between Coordinated Universal Time (UTC) and local time. For example, Middle European Time (MET, GMT+01:00) has a time zone bias of "-60" because it is one hour ahead of UTC. Pacific Standard Time (PST, GMT-08:00) has a time zone bias of "+480" because it is eight hours behind UTC. For instance, date(value - bias/24/60) converts the UTC time to local time, or date(date('now') + bias/24/60) converts the current local time to UTC time. For instance, "date(value - bias/24/60)" converts the value date-time from UTC to local time, while "date(value + bias/24/60)" converts the local-time to UTC time.
  • dpi ( DPI constant ), specifies the current DPI setting. and it indicates the minimum value between dpix and dpiy constants. For instance, if current DPI setting is 100%, the dpi constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpi returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%
  • dpix ( DPIX constant ), specifies the current DPI setting on x-scale. For instance, if current DPI setting is 100%, the dpix constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpix returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%
  • dpiy ( DPIY constant ), specifies the current DPI setting on x-scale. For instance, if current DPI setting is 100%, the dpiy constant returns 1, if 150% it returns 1.5, and so on. For instance, the expression value * dpiy returns the value if the DPI setting is 100%, or value * 1.5 in case, the DPI setting is 150%

The supported binary arithmetic operators are:

  • * ( multiplicity operator ), priority 5
  • / ( divide operator ), priority 5
  • mod ( reminder operator ), priority 5
  • + ( addition operator ), priority 4 ( concatenates two strings, if one of the operands is of string type )
  • - ( subtraction operator ), priority 4

The supported unary boolean operators are:

  • not ( not operator ), priority 3 ( high priority )

The supported binary boolean operators are:

  • or ( or operator ), priority 2
  • and ( or operator ), priority 1

The supported binary boolean operators, all these with the same priority 0, are :

  • < ( less operator )
  • <= ( less or equal operator )
  • = ( equal operator )
  • != ( not equal operator )
  • >= ( greater or equal operator )
  • > ( greater operator )

The supported binary range operators, all these with the same priority 5, are :

  • a MIN b ( min operator ), indicates the minimum value, so a MIN b returns the value of a, if it is less than b, else it returns b. For instance, the expression value MIN 10 returns always a value greater than 10.
  • a MAX b ( max operator ), indicates the maximum value, so a MAX b returns the value of a, if it is greater than b, else it returns b. For instance, the expression value MAX 100 returns always a value less than 100.

The supported binary operators, all these with the same priority 0, are :

  • := (Store operator), stores the result of expression to variable. The syntax for := operator is

    variable := expression

    where variable is a integer between 0 and 9. You can use the =: operator to restore any stored variable ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable

  • =: (Restore operator), restores the giving variable ( previously saved using the store operator ). The syntax for =: operator is

    =: variable

    where variable is a integer between 0 and 9. You can use the := operator to store the value of any expression ( please make the difference between := and =: ). For instance, (0:=dbl(value)) = 0 ? "zero" : =:0, stores the value converted to double, and prints zero if it is 0, else the converted number. Please pay attention that the := and =: are two distinct operators, the first for storing the result into a variable, while the second for restoring the variable

The supported ternary operators, all these with the same priority 0, are :

  • ? ( Immediate If operator ), returns and executes one of two expressions, depending on the evaluation of an expression. The syntax for ? operator is

expression ? true_part : false_part

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the %0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found') returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

  • array (at operator), returns the element from an array giving its index ( 0 base ). The array operator returns empty if the element is found, else the associated element in the collection if it is found. The syntax for array operator is

expression array (c1,c2,c3,...cn)

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D') is equivalent with month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D').

  • in (include operator), specifies whether an element is found in a set of constant elements. The in operator returns -1 ( True ) if the element is found, else 0 (false) is retrieved. The syntax for in operator is

expression in (c1,c2,c3,...cn)

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the value in (11,22,33,44,13) is equivalent with (expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13). The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

  • switch (switch operator), returns the value being found in the collection, or a predefined value if the element is not found (default). The syntax for switch operator is

expression switch (default,c1,c2,c3,...,cn)

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions. The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found, while the returned value is the value itself instead -1. For instance, the %0 switch ('not found',1,4,7,9,11) gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

  • case() (case operator) returns and executes one of n expressions, depending on the evaluation of the expression ( IIF - immediate IF operator is a binary case() operator ). The syntax for case() operator is:

expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1) indicates that only #1/1/2002#, #2/1/2002#, #4/1/2002# and #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8) statement indicates the working hours for dates as follows:

  • #4/1/2009#, from hours 06:00 AM to 12:00 PM
  • #4/5/2009#, from hours 07:00 AM to 10:00 AM and hours 03:00PM, 04:00PM, 06:00PM and 10:00PM
  • #5/1/2009#, from hours 12:00 AM to 08:00 AM

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions. Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator.

The supported conversion unary operators are:

  • type (unary operator) retrieves the type of the object. The type operator may return any of the following: 0 - empty ( not initialized ), 1 - null, 2 - short, 3 - long, 4 - float, 5 - double, 6 - currency, 7 - date, 8 - string, 9 - object, 10 - error, 11 - boolean, 12 - variant, 13 - any, 14 - decimal, 16 - char, 17 - byte, 18 - unsigned short, 19 - unsigned long, 20 - long on 64 bits, 21 - unsigned long on 64 bites. For instance type(%1) = 8 specifies the cells ( on the column with the index 1 ) that contains string values.
  • str (unary operator) converts the expression to a string. The str operator converts the expression to a string. For instance, the str(-12.54) returns the string "-12.54".
  • dbl (unary operator) converts the expression to a number. The dbl operator converts the expression to a number. For instance, the dbl("12.54") returns 12.54
  • date (unary operator) converts the expression to a date, based on your regional settings. For instance, the date(``) gets the current date ( no time included ), the date(`now`) gets the current date-time, while the date("01/01/2001") returns #1/1/2001#
  • dateS (unary operator) converts the string expression to a date using the format MM/DD/YYYY HH:MM:SS. For instance, the dateS("01/01/2001 14:00:00") returns #1/1/2001 14:00:00#
  • hex (unary operator) converts the giving string from hexa-representation to a numeric value, or converts the giving numeric value to hexa-representation as string. For instance, hex(`FF`) returns 255, while the hex(255) or hex(0xFF) returns the `FF` string. The hex(hex(`FFFFFFFF`)) always returns `FFFFFFFF` string, as the second hex call converts the giving string to a number, and the first hex call converts the returned number to string representation (hexa-representation).

The bitwise operators for numbers are:

  • a bitand b (binary operator) computes the AND operation on bits of a and b, and returns the unsigned value. For instance, 0x01001000 bitand 0x10111000 returns 0x00001000.
  • a bitor b (binary operator) computes the OR operation on bits of a and b, and returns the unsigned value. For instance, 0x01001000 bitor 0x10111000 returns 0x11111000.
  • a bitxor b (binary operator) computes the XOR ( exclusive-OR ) operation on bits of a and b, and returns the unsigned value. For instance, 0x01110010 bitxor 0x10101010 returns 0x11011000.
  • a bitshift (b) (binary operator) shifts every bit of a value to the left if b is negative, or to the right if b is positive, for b times, and returns the unsigned value. For instance, 128 bitshift 1 returns 64 ( dividing by 2 ) or 128 bitshift (-1) returns 256 ( multiplying by 2 )
  • bitnot ( unary operator ) flips every bit of x, and returns the unsigned value. For instance, bitnot(0x00FF0000) returns 0xFF00FFFF.

The operators for numbers are:

  • int (unary operator) retrieves the integer part of the number. For instance, the int(12.54) returns 12
  • round (unary operator) rounds the number ie 1.2 gets 1, since 1.8 gets 2. For instance, the round(12.54) returns 13
  • floor (unary operator) returns the largest number with no fraction part that is not greater than the value of its argument. For instance, the floor(12.54) returns 12
  • abs (unary operator) retrieves the absolute part of the number ie -1 gets 1, 2 gets 2. For instance, the abs(-12.54) returns 12.54
  • sin (unary operator) returns the sine of an angle of x radians. For instance, the sin(3.14) returns 0.001593.
  • cos (unary operator) returns the cosine of an angle of x radians. For instance, the cos(3.14) returns -0.999999.
  • asin (unary operator) returns the principal value of the arc sine of x, expressed in radians. For instance, the 2*asin(1) returns the value of PI.
  • acos (unary operator) returns the principal value of the arc cosine of x, expressed in radians. For instance, the 2*acos(0) returns the value of PI
  • sqrt (unary operator) returns the square root of x. For instance, the sqrt(81) returns 9.
  • currency (unary operator) formats the giving number as a currency string, as indicated by the control panel. For instance, currency(value) displays the value using the current format for the currency ie, 1000 gets displayed as $1,000.00, for US format.
  • value format 'flags' (binary operator) formats the value with specified flags. If flags is empty, the number is displayed as shown in the field "Number" in the "Regional and Language Options" from the Control Panel. For instance the 1000 format '' displays 1,000.00 for English format, while 1.000,00 is displayed for German format. 1000 format '2|.|3|,' will always displays 1,000.00 no matter of settings in the control panel. If formatting the number fails for some invalid parameter, the value is displayed with no formatting.

    The ' flags' for format operator is a list of values separated by | character such as 'NumDigits|DecimalSep|Grouping|ThousandSep|NegativeOrder|LeadingZero' with the following meanings:

    • NumDigits - specifies the number of fractional digits, If the flag is missing, the field "No. of digits after decimal" from "Regional and Language Options" is using.
    • DecimalSep - specifies the decimal separator. If the flag is missing, the field "Decimal symbol" from "Regional and Language Options" is using.
    • Grouping - indicates the number of digits in each group of numbers to the left of the decimal separator. Values in the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00. If the flag is missing, the field "Digit grouping" from "Regional and Language Options" indicates the grouping flag.
    • ThousandSep - specifies the thousand separator. If the flag is missing, the field "Digit grouping symbol" from "Regional and Language Options" is using.
    • NegativeOrder - indicates the negative number mode. If the flag is missing, the field "Negative number format" from "Regional and Language Options" is using. The valid values are 0, 1, 2, 3 and 4 with the following meanings:
      • 0 - Left parenthesis, number, right parenthesis; for example, (1.1)
      • 1 - Negative sign, number; for example, -1.1
      • 2 - Negative sign, space, number; for example, - 1.1
      • 3 - Number, negative sign; for example, 1.1-
      • 4 - Number, space, negative sign; for example, 1.1 -
    • LeadingZero - indicates if leading zeros should be used in decimal fields. If the flag is missing, the field "Display leading zeros" from "Regional and Language Options" is using. The valid values are 0, 1

The operators for strings are:

  • len (unary operator) retrieves the number of characters in the string. For instance, the len("Mihai") returns 5.
  • lower (unary operator) returns a string expression in lowercase letters. For instance, the lower("MIHAI") returns "mihai"
  • upper (unary operator) returns a string expression in uppercase letters. For instance, the upper("mihai") returns "MIHAI"
  • proper (unary operator) returns from a character expression a string capitalized as appropriate for proper names. For instance, the proper("mihai") returns "Mihai"
  • ltrim (unary operator) removes spaces on the left side of a string. For instance, the ltrim(" mihai") returns "mihai"
  • rtrim (unary operator) removes spaces on the right side of a string. For instance, the rtrim("mihai ") returns "mihai"
  • trim (unary operator) removes spaces on both sides of a string. For instance, the trim(" mihai ") returns "mihai"
  • reverse (unary operator) reverses the order of the characters in the string a. For instance, the reverse("Mihai") returns "iahiM"
  • a startwith b (binary operator) specifies whether a string starts with specified string ( 0 if not found, -1 if found ). For instance "Mihai" startwith "Mi" returns -1
  • a endwith b (binary operator) specifies whether a string ends with specified string ( 0 if not found, -1 if found ). For instance "Mihai" endwith "ai" returns -1
  • a contains b (binary operator) specifies whether a string contains another specified string ( 0 if not found, -1 if found ). For instance "Mihai" contains "ha" returns -1
  • a left b (binary operator) retrieves the left part of the string. For instance "Mihai" left 2 returns "Mi".
  • a right b (binary operator) retrieves the right part of the string. For instance "Mihai" right 2 returns "ai"
  • a lfind b (binary operator) The a lfind b (binary operator) searches the first occurrence of the string b within string a, and returns -1 if not found, or the position of the result ( zero-index ). For instance "ABCABC" lfind "C" returns 2
  • a rfind b (binary operator) The a rfind b (binary operator) searches the last occurrence of the string b within string a, and returns -1 if not found, or the position of the result ( zero-index ). For instance "ABCABC" rfind "C" returns 5.
  • a mid b (binary operator) retrieves the middle part of the string a starting from b ( 1 means first position, and so on ). For instance "Mihai" mid 2 returns "ihai"
  • a count b (binary operator) retrieves the number of occurrences of the b in a. For instance "Mihai" count "i" returns 2.
  • a replace b with c (double binary operator) replaces in a the b with c, and gets the result. For instance, the "Mihai" replace "i" with "" returns "Mha" string, as it replaces all "i" with nothing.
  • a split b (binary operator) splits the a using the separator b, and returns an array. For instance, the weekday(value) array 'Sun Mon Thu Wed Thu Fri Sat' split ' ' gets the weekday as string. This operator can be used with the array.
  • a like b (binary operator) compares the string a against the pattern b. The pattern b may contain wild-characters such as *, ?, # or [] and can have multiple patterns separated by space character. In order to have the space, or any other wild-character inside the pattern, it has to be escaped, or in other words it should be preceded by a \ character. For instance value like `F*e` matches all strings that start with F and ends on e, or value like `a* b*` indicates any strings that start with a or b character.
  • a lpad b (binary operator) pads the value of a to the left with b padding pattern. For instance, 12 lpad "0000" generates the string "0012".
  • a rpad b (binary operator) pads the value of a to the right with b padding pattern. For instance, 12 lpad "____" generates the string "12__".
  • a concat b (binary operator) concatenates the a (as string) for b times. For instance, "x" concat 5, generates the string "xxxxx".

The operators for dates are:

  • time (unary operator) retrieves the time of the date in string format, as specified in the control's panel. For instance, the time(#1/1/2001 13:00#) returns "1:00:00 PM"
  • timeF (unary operator) retrieves the time of the date in string format, as "HH:MM:SS". For instance, the timeF(#1/1/2001 13:00#) returns "13:00:00"
  • shortdate (unary operator) formats a date as a date string using the short date format, as specified in the control's panel. For instance, the shortdate(#1/1/2001 13:00#) returns "1/1/2001"
  • shortdateF (unary operator) formats a date as a date string using the "MM/DD/YYYY" format. For instance, the shortdateF(#1/1/2001 13:00#) returns "01/01/2001"
  • dateF (unary operator) converts the date expression to a string expression in "MM/DD/YYYY HH:MM:SS" format. For instance, the dateF(#01/01/2001 14:00:00#) returns #01/01/2001 14:00:00#
  • longdate (unary operator) formats a date as a date string using the long date format, as specified in the control's panel. For instance, the longdate(#1/1/2001 13:00#) returns "Monday, January 01, 2001"
  • year (unary operator) retrieves the year of the date (100,...,9999). For instance, the year(#12/31/1971 13:14:15#) returns 1971
  • month (unary operator) retrieves the month of the date ( 1, 2,...,12 ). For instance, the month(#12/31/1971 13:14:15#) returns 12.
  • day (unary operator) retrieves the day of the date ( 1, 2,...,31 ). For instance, the day(#12/31/1971 13:14:15#) returns 31
  • yearday (unary operator) retrieves the number of the day in the year, or the days since January 1st ( 0, 1,...,365 ). For instance, the yearday(#12/31/1971 13:14:15#) returns 365
  • weekday (unary operator) retrieves the number of days since Sunday ( 0 - Sunday, 1 - Monday,..., 6 - Saturday ). For instance, the weekday(#12/31/1971 13:14:15#) returns 5.
  • hour (unary operator) retrieves the hour of the date ( 0, 1, ..., 23 ). For instance, the hour(#12/31/1971 13:14:15#) returns 13
  • min (unary operator) retrieves the minute of the date ( 0, 1, ..., 59 ). For instance, the min(#12/31/1971 13:14:15#) returns 14
  • sec (unary operator) retrieves the second of the date ( 0, 1, ..., 59 ). For instance, the sec(#12/31/1971 13:14:15#) returns 15

The expression supports also immediate if ( similar with iif in visual basic, or ? : in C++ ) ie cond ? value_true : value_false, which means that once that cond is true the value_true is used, else the value_false is used. Also, it supports variables, up to 10 from 0 to 9. For instance, 0:="Abc" means that in the variable 0 is "Abc", and =:0 means retrieves the value of the variable 0. For instance, the len(%0) ? ( 0:=(%1+%2) ? currency(=:0) else `` ) : `` gets the sum between second and third column in currency format if it is not zero, and only if the first column is not empty. As you can see you can use the variables to avoid computing several times the same thing ( in this case the sum %1 and %2 .