@...COMBOBOX \/ DEFINE COMBOBOX

Creates a ComboBox control

Standard Syntax (xBase Style):

 @ <nRow> ,<nCol>
 COMBOBOX <ControlName>
 [ OF | PARENT <ParentWindowName> ]
 [ ITEMS <caItems> ]
 [ ITEMSOURCE <ItemSourceField1> [ , <ItemSourceField2> ] ]
 [ VALUE <nValue> ]
 [ VALUESOURCE <ValueSourceField> ]
 [ DISPLAYEDIT ]
 [ WIDTH <nWodth> ]
 [ HEIGHT <nHeight>]
 [ FONT <cFontName> SIZE <nFontSize> ]
 [ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
 [ TOOLTIP <cToolTipText> ]
 [ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
 [ ON CHANGE <OnChangeProcedure> | <bBlock> ]
 [ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
 [ ON ENTER <OnEnterProcedure> | <bBlock> ]
 [ ON DISPLAYCHANGE <OnDisplayChangeProcedure> | <bBlock> ]
 [ ON DROPDOWN <OnDropDownProcedure> | <bBlock> ]
 [ ON CLOSEUP <OnCloseUpProcedure> | <bBlock> ]
 [ NOTABSTOP ]
 [ HELPID <nHelpId> ]
 [ BREAK ]
 [ GRIPPERTEXT <cGripperText> ]
 [ INVISIBLE ]
 [ SORT ]
 [ IMAGE <acImageNames> ]
 [ DROPPEDWIDTH <nDroppedWidth> ]
 [ ON CANCEL <OnCancelProcedure> | <bBlock> ]
 [ NOTRANSPARENT ]

Alternate Syntax:

DEFINE COMBOBOX <Controlname>
   PARENT <ParentWindowName>
   ROW <nValue>
   COL <nValue>
   WIDTH <nValue>
   HEIGHT <nValue>
   FONTNAME <cValue>
   FONTSIZE <nValue>
   FONTBOLD <lValue>
   FONTITALIC <lValue>
   FONTUNDERLINE <lValue>
   FONTSTRIKEOUT <lValue>
   TOOLTIP <cValue>
   ONGOTFOCUS <ActionProcedure>
   ONLOSTFOCUS <ActionProcedure>
   ONCHANGE <ActionProcedure>
   TABSTOP <lValue>
   HELPID <nValue>
   VISIBLE <lValue>
   ITEMS <caItems>
   ITEMSOURCE <ItemSourceField1> [ , <ItemSourceField2> ]
   VALUE <nValue>
   VALUESOURCE <ValueSourceField>
   DISPLAYEDIT <lValue>
   BREAK <lvalue>
   GRIPPERTEXT <cGripperText>
   SORT <lValue>
   IMAGE <acImageNames>
   DROPPEDWIDTH <nDroppedWidth>
   ONCANCEL <OnCancelProcedure>
   TRANSPARENT <lValue>
END COMBOBOX

Properties:

D: Available at control definition only R: Read-Only

Events:

  • OnGotFocus
  • OnChange
  • OnLostFocus
  • OnDisplayChange
  • OnEnter
  • OnDropDown
  • OnCloseUp
  • OnCancel

Methods:

  • Show
  • Hide
  • AddItem ( cItemText )
  • DeleteItem ( nItemIndex )
  • DeleteAllItems
  • SetFocus
  • Release

Hints:

  • In a ComboBox the 'Height' clause refers to the total height (considering extended list height)
  • When used in control definition, ITEM property must be a character array.
  • When ITEMSOURCE property is set to a fieldname, 'Value' property uses the physical record number, as in browse.
  • If you set the VALUESOURCE property to a fieldname, its content is returned instead the physical record number.
  • 'DroppedWidth' property is used to set the dropdown list in a combobox control. 'DroppedWidth' can't be less that ComboBox width.
  • OnDropDown Event will be executed when the user attempt to open dropdown list

Image Support:

  • 'Image' Property specify a character array containing image file names or resource names.
  • When you add an item, must specify the image array index number (zero based) and the text associated with it.
  • When adding items at startup you must to use a two dimensional array.
  • This array must have one row for each combo item and two columns.
  • The first column must contain the image index and the second the text for the item.
  • When using the additem or Item properties you must use a single array containing two elements. The first, the image index item and the second, the text for the item.
  • When you retrieve the item, using the 'item' property, it will return a two elements array containing the image index and the text of the item.
  • When 'Image' and 'ItemSource' properties are used simultaneously, 'ItemSource' must be specified as a list containing two field names.
  • The first, the image index for the items, the second, the item text.
  • 'Sort' and 'Image' can't be used simultaneously.

results matching ""

    No results matching ""