@...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> ]]
[ ON INIT <bInit> ]
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> ]]
[ ON INIT <bInit> ]
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> ]]
[ ON INIT <bInit> ]
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> ]]
[ ON INIT <bInit> ]
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.> ]]
[ ONINIT <bInit> ]
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.
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:
Set / Gets ComboBox value.
| |
Set / Gets enabled state of a ComboBox control
| |
Set / Gets visible a ComboBox control.
| |
Set / Gets item text in a ComboBox
| |
Get item count in a ComboBox
| |
Set / Gets item height of a ComboBox control
| |
Set / Gets row position of a ComboBox control.
| |
Set / Gets column position of a ComboBox control.
| |
Set / Gets width of a ComboBox control.
| |
Set / Gets height of a ComboBox control.
| |
Set / Gets ComboBox control's font name.
| |
Set / Gets ComboBox control's font size.
| |
Set / Gets ComboBox control's font bold property
| |
Set / Gets ComboBox control's font italic property
| |
Set / Gets ComboBox control's font underline property
| |
Set / Gets ComboBox control's font strikeout property
| |
Set / Gets ComboBox control's tooltip text.
| |
Set / Gets user property 'Cargo' for ComboBox control
| |
Retrieves the name of a ComboBox control.
| |
Set the name as character identifier of the parent window.
| |
Set the numeric help topic identifier of the control.
| |
Transforms all characters to uppercase
| |
Transforms all characters to lowercase
| |
Sets whether an element behavior can't receive focus and participate
in the tabbing sequence
| |
Filled the ComboBox with the content of a table field.
| |
Set the SORT style of a ComboBox control
| |
Allows user to edit selected item text in display area.
| |
Sets ComboBox control's readonly property
| |
Gets value - formatted characters string from display area.
| |
Control passes to the statement that follows the terminated
statement.
| |
Set the caption for the gripping
|
D: Available at control definition only
R: Read-Only
EVENTS:
Action to be performed when getting the focus
| |
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.
| |
Action to be performed when pressing a Enter key
|
METHODS:
Shows a ComboBox control
| |
Hides a ComboBox control
| |
Redraw a Control
| |
Add a new item to a ComboBox control
| |
Deletes an item from a ComboBox control
| |
Deletes all items from a ComboBox control
| |
Gives the focus to a ComboBox control
| |
Set array to the ComboBox control
| |
Get array to the ComboBox control
| |
Releases a ComboBox control from memory
| |
Update enables for ComboBox control
| |
Update disables for ComboBox control
| |
Save a ComboBox control as BitMap file.
| |
Refresh ComboBox control
|
EXAMPLE: