@...COMBOBOX
DEFINE COMBOBOX
Creates a ComboBox control.
  

A ComboBox is a unique type of control, that combines much of the functionality of a list box and an edit control.

SYNTAX

Standard Window:

@ <nRow> ,<nCol> COMBOBOX <ControlName>
[ ID <
nId> ]
[ OF | PARENT | DIALOG <
ParentWindowName> ]
[ WIDTH <
nWodth> ]
[ HEIGHT <
nHeight>]
[ ITEMS <
caItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ LISTWIDTH | DROPPEDWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON ENTER <
OnEnterProcedure> | <bBlock> ]
[ ON DISPLAYCHANGE <
OnDisplayChangeProcedure> | <bBlock> ]
[ ON LISTDISPLAY | ON DROPPDOWN <
OnListDisplayProcedure> | <bBlock> ]
[ ON LISTCLOSE | ON CLOSEUP <
OnListCloseProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <
nHelpId> ]
[ INVISIBLE ]
[ SORT ]

Dialog Window:

REDEFINE COMBOBOX <ControlName>
ID <
nId>
[ OF | PARENT | DIALOG <
ParentWindowName> ]
[ ITEMS <
caItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ LISTWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON ENTER <
OnEnterProcedure> | <bBlock> ]
[ ON DISPLAYCHANGE <
OnDisplayChangeProcedure> | <bBlock> ]
[ ON LISTDISPLAY <
OnListDisplayProcedure> | <bBlock> ]
[ ON LISTCLOSE <
OnListCloseProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <
nHelpId> ]
[ INVISIBLE ]
[ SORT ]

SPLITBOX VERSION

COMBOBOX <ControlName>
[ OF | PARENT <
ParentWindowName> ]
[ WIDTH <
nWodth> ]
[ HEIGHT <
nHeight>]
[ ITEMS <
caItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ LISTWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON ENTER <
OnEnterProcedure> | <bBlock> ]
[ ON DISPLAYCHANGE <
OnDisplayChangeProcedure> | <bBlock> ]
[ ON LISTDISPLAY <
OnListDisplayProcedure> | <bBlock> ]
[ ON LISTCLOSE <
OnListCloseProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <
nHelpId> ]
[ GRIPPERTEXT <
cGripperText> ]
[ BREAK ]
[ INVISIBLE ]
[ SORT ]

COMBOBOX <ControlName>
[ OF | PARENT <
ParentWindowName> ]
[ WIDTH <
nWodth> ]
[ HEIGHT <
nHeight>]
[ ITEMS <
caItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ DROPPEDWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ 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> ]
[ GRIPPERTEXT <
cGripperText> ]
[ BREAK ]
[ INVISIBLE ]
[ SORT ]


Alternate Syntax:

DEFINE COMBOBOX <Controlname>

[ ID <nId> ]
[ PARENT <
ParentWindowName> ]
COL <
nCol>
ROW <
nRow>
[ WIDTH <
nWodth> ]
[ HEIGHT <
nHeight>]
[ ITEMS <
caItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT  < .T. | .F.> ]
[ LISTWIDTH <
nValue> ]
[ FONTNAME <
cFontname>
[ FONTSIZE <
nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ UPPERCASE < .T. | .F.>  ]
[ LOWERCASE < .T. | .F. ]
[[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ONGOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ONCHANGE <
OnChangeProcedure> | <bBlock> ]
[ ONLOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ONENTER <
OnEnterProcedure> | <bBlock> ]
[ ONDISPLAYCHANGE <
OnDisplayChangeProcedure> | <bBlock> ]
[ ONLISTDISPLAY <
OnListDisplayProcedure> | <bBlock> ]
[ ONLISTCLOSE <
OnListCloseProcedure> | <bBlock> ]
[ NOTABSTOP < .T. | .F.> ]
[ HELPID <
nHelpId> ]
[ INVISIBLE < .T. | .F.> ]
[ SORT < .T. | .F.> ]

END COMBOBOX

Remarks:

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.

DESCRIPTION:
nRow, nCol
Position in the area of ??the window in pixels.
nWidth, nHeigth
The desired size of the ComboBox Control in pixels.
nId
The ID identifier this Control in Dialog Window
ControlName
A reference to the CmboBox Control
ParentWindowName
A reference to the Parent Window.
nHelpId
The help topic identifier for this Control


PROPERTIES:

·   Value
Set / Gets ComboBox value.
·   Enabled
Set / Gets enabled state of a ComboBox control
·   Visible
Set / Gets visible a ComboBox control.
·   Item ( nItemIndex )
Set / Gets item text in a ComboBox
·   ItemCount (R)
Get item count in a ComboBox
·   Row
Set / Gets row position of a ComboBox control.
·   Col
Set / Gets column position of a ComboBox control.
·   Width
Set / Gets width of a ComboBox control.
·   Height
Set / Gets height of a ComboBox control.
·   FontName
Set / Gets ComboBox control's font name.
·   FontSize
Set / Gets ComboBox control's font size.
·   FontBold
Set / Gets ComboBox control's font bold property
·   FontItalic
Set / Gets ComboBox control's font italic property
Set / Gets ComboBox control's font underline property
Set / Gets ComboBox control's font strikeout property
·   ToolTip
Set / Gets ComboBox control's tooltip text.
·   Cargo
Set / Gets user property 'Cargo' for ComboBox control
·   Name (R)
Retrieves the name of a ComboBox control.
·   Parent (D)
Set the name as character identifier of the parent window.
·   HelpId (D)
Set the numeric help topic identifier of the control.
·   UpperCase (D)
Transforms all characters to uppercase
·   LowerCase (D)
Transforms all characters to lowercase
·   NoTabStop (D)
Sets whether an element behavior can't receive focus and participate in the tabbing sequence
·   ItemSource (D)
Filled the ComboBox with the content of a table field.
·   Sort (D)
Set the SORT style of a ComboBox control
·   DisplayEdit (D)
Allows user to edit selected item text in display area.
·   DisplayValue (R)
Gets value -  formated characters string from display area.
·   Break (D)
Control passes to the statement that follows the terminated statement.
·   GripperText (D)
Set the caption for the gripping

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

EVENTS:

·   OnGotFocus
An action to be performed when getting the focus
·   OnChange
An action to be performed when generic changing of the control
Action to be performed when changing of display the control
Action to be performed when closed of display the control
Action to be performed when closed of list the control
An action to be performed when losing the focus.
·   OnEnter
Action to be performed when pressing a Enter key

METHODS:

·   Show
Shows a ComboBox control
·   Hide
Hides a ComboBox control
·   AddItem( cItemText )
Add a new item to a ComboBox control
·   DeleteItem( nItemIndex )
Deletes an item from a ComboBox control
Deletes all items from a ComboBox control
·   SetFocus
Gives the focus to a ComboBox control
·   Release
Releases a ComboBox control from memory
Update enables for ComboBox control
Update disables for ComboBox control
·   SaveAs
Save a ComboBox control as BitMap file.

EXAMPLE:

See demos in :
\Samples\Basic\Combo_2
\Samples\Basic\Combo_5
\Samples\Basic\Combo_OnList
\Samples\Basic\Color
\Samples\Basic\MAINDEMO_(SYNTAX_I) to _(SYNTAX_IV)