@...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 <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ LISTWIDTH | DROPPEDWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <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 ]

[ CUEBANNER | PLACEHOLDER> <CueText>
[ AUTOCOMPLETE> [ SHOWDROPDOWN <showdd> ]]

Dialog Window:

REDEFINE COMBOBOX <ControlName>
ID <
nId>
[ OF | PARENT | DIALOG <
ParentWindowName> ]
[ ITEMS <
acItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ LISTWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <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 ]

[ CUEBANNER | PLACEHOLDER> <CueText>
[ AUTOCOMPLETE> [ SHOWDROPDOWN <showdd> ]]

SPLITBOX VERSION

COMBOBOX <ControlName>
[ OF | PARENT <
ParentWindowName> ]
[ WIDTH <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ LISTWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ 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 ]

[ CUEBANNER | PLACEHOLDER> <CueText>
[ AUTOCOMPLETE> [ SHOWDROPDOWN <showdd> ]]

COMBOBOX <ControlName>
[ OF | PARENT <
ParentWindowName> ]
[ WIDTH <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ ITEMSOURCE <
ItemSourceField> ]
[ VALUE <
nValue> ]
[ VALUESOURCE <
ValueSourceField> ]
[ DISPLAYEDIT ]
[ DROPPEDWIDTH <
nValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ UPPERCASE ]
[ LOWERCASE ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <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 ]

[ CUEBANNER | PLACEHOLDER> <CueText>
[ AUTOCOMPLETE> [ SHOWDROPDOWN <showdd> ]]


Alternate Syntax:

DEFINE COMBOBOX <ControlName>

[ ID <nId> ]
[ PARENT <
ParentWindowName> ]
COL <
nCol>
ROW <
nRow>
[ WIDTH <
nWodth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ 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 <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ONGOTFOCUS <
OnGotFocusProcedure> | <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.> ]

[ CUEBANNER | PLACEHOLDER> <CueText>

[ AUTOCOMPLETE < .T. | .F.> [ SHOWDROPDOWN < .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. ie: { "One", "Two", "Three" }

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 of the physical record number.



DESCRIPTION:
nRow, nCol
Position in the area of ??the window in pixels.
nWidth, nHeight
The desired size of the ComboBox Control in pixels.
nId
The ID identifier this Control in Dialog Window
ControlName
A reference to the ComboBox Control
ParentWindowName
A reference to the Parent Window.
nHelpId
The help topic identifier for this Control
caItems
Specifies a List of Items for the ComboBox control (See above)
ItemSourceField
Specifies a Field Name to use as data source ie: Info->Name
nValue
Specifies the startup value
nValueSourceField
Specifies the Field to be used as return value must be used in combination with ITEMSOURCE ie: Info->No
(see remarks above)
cFontName
Specifies the Font Name
nFontSize
Specifies the Font Size
cToolTipText
Specifies the Text for the ToolTip
aBackColor
Specifies the Background Color
aFontColor
Specifies the Font Color
OnGotFocusProcedure
An action to be performed on GotFocus
OnChangeProcedure
An action to be performed on Change
OnLostFocusProcedure
An action to be performed on lostFocus
OnEnterProcedure
An action to be performed on Enter
OnDisplayChangeProcedure
An action to be performed on Display Change
OnListDisplayProcedure
An action to be performed on List Display
OnListCloseProcedure
An action to be performed on List Close
cGripperText
Specifies the Gripper text
 
 
DISPLAYEDIT
Specifies that we can type a value in the ComboBox
UPPERCASE
Specifies whether character will be automatically converted to uppercase
LOWERCASE
Specifies whether character will be automatically converted to lowercase
NOTABSTOP
Stop the control to receive focus and participate in the tabbing sequence
INVISIBLE
The visibility property specifies whether or not a control is visible
SORT
Sort the items in the ComboBox in alphabetical order


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
·   ItemHeight
Set / Gets item height of a ComboBox control
·   Row
Set / Gets row position of a ComboBox control.
·   ol
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.
·   ReadOnly
Sets  ComboBox control's readonly property
·   DisplayValue (R)
Gets value -  formatted 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
Action to be performed when getting the focus
·   OnChange
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
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
·   SetArray
Set array to the 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.
·   Refresh
Refresh ComboBox control

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)

and sample in Chapter:
More Choices II