@...LISTBOX
DEFINE LISTBOX 
  

Creates a listbox control.

SYNTAX

Standard Window:

@ <nRow> ,<nCol> LISTBOX <ControlName>
[ ID <
nId> ]
[ OF | PARENT | DIALOG <
ParentWindowName> ]
[ WIDTH <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ VALUE <
anValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT ]
[ DRAGITEMS ]
[ HELPID <
nHelpId> ]
[ INVISIBLE ]
[ NOTABSTOP ]
[ SORT ]

Dialog Window:

REDEFINE LISTBOX <ControlName>
ID <
nId>
[ OF | PARENT | DIALOG <
ParentWindowName> ]
[ ITEMS <
acItems> ]
[ VALUE <
anValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT ]
[ DRAGITEMS ]
[ HELPID <
nHelpId> ]
[ INVISIBLE ]
[ NOTABSTOP ]
[ SORT ]

SPLITBOX VERSION

LISTBOX <ControlName>
[ OF | PARENT <
ParentWindowName> ]
[ WIDTH <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ VALUE <
anValue> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT ]
[ DRAGITEMS ]
[ HELPID <
nHelpId> ]
[ BREAK ]
[ INVISIBLE ]
[ NOTABSTOP ]
[ SORT ]

Alternate Syntax:

DEFINE LISTBOX

[ ID <nId> ]
[ PARENT <
ParentWindowName> ]
COL <
nCol>
ROW <
nRow>
[ WIDTH <
nWidth> ]
[ HEIGHT <
nHeight> ]
[ ITEMS <
acItems> ]
[ VALUE <
anValue> ]
[ FONTNAME <
cFontname>
[ FONTSIZE <
nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ TOOLTIP <
cToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ONGOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ONCHANGE <
OnChangeProcedure> | <bBlock> ]
[ ONLOSTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ONDBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT < .T. | .F.> ]
[ DRAGITEMS < .T. | .F.> ]
[ HELPID <
nHelpId> ]
[ INVISIBLE < .T. | .F.> ]
[ NOTABSTOP < .T. | .F.> ]
[ SORT < .T. | .F.> ]

END LISTBOX

Remarks

If MULTISELECT clause is used VALUE must be a numeric array, containing the index position of selected items.

When used in control definition, ITEM property must be a character array.

PROPERTIES:

·   Value
Set / Gets ListBox value.
·   Enabled
Set / Gets enabled state of a ListBox control
·   Visible          
Set / Gets visible a ListBox control.
·   Item ( nItemIndex )
Set / Gets item text in a ListBox
·   ItemCount (R)
Get item count in a ListBox
·   Row
Set / Gets row position of a ListBox control.
·   Col   
Set / Gets column position of a ListBox control.
·   Width
Set / Gets width of a ListBox control.
·   Height
Set / Gets height of a ListBox control.
·   FontName
Set / Gets ListBox control's font name.
·   FontSize
Set / Gets ListBox control's font size.
·   FontBold
Set / Gets ListBox control's font bold property
·   FontItalic
Set / Gets ListBox control's font italic property
Set / Gets ListBox control's font underline property
Set / Gets ListBox control's font strikeout property
·   FontColor
Set / Gets the foreground color for text within the ListBox
·   BackColor
Set / Gets the background color for text within the ListBox
·   ToolTip
Set / Gets ListBox control's tooltip text.
·   Cargo
Set / Gets user property 'Cargo' for ListBox control
·   Name (R)
Retrieves the name of a ListBox control.
·   Parent (D)
Set the name as character identifier of the parent window.
·   HelpId (D)
Set the numeric help topic identifier of the control.
·   NoTabStop (D)
Sets whether an element behavior can't receive focus and participate in the tabbing sequence
·   MultiSelect (D)
Sets a value indicating whether multiple items can be selected
·   DragItems (D)
Specifies whether the items in a ListBox can be arranged by the user.
·   Sort (D)
Sets to automatically sort strings alphabetically in a ListBox
·   Break (D)
Control passes to the statement that follows the terminated statement.

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
An action to be performed when losing the focus.
·   OnDblClick
An action to be performed when Double Left clicking.

METHODS:

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

EXAMPLE:

See demos in :
\Samples\Basic\ListBox
\Samples\Basic\ListBox_2
\Samples\Basic\MAINDEMO_(SYNTAX_I) to _(SYNTAX_IV)