@...LISTBOX
DEFINE LISTBOX 
Create a ListBox control
  

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 <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT ]
[ MULTITAB [ TABSWIDTH <
aWidth> ] ]
[ MULTICOLUMN ]
[ 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 <
OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT ]
[ MULTITAB [ TABSWIDTH <
aWidth> ] ]
[ MULTICOLUMN  ]
[ 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 <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ON GOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ON CHANGE <
OnChangeProcedure> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ON DBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT ]
[ MULTITAB [ TABSWIDTH <
aWidth> ] ]
[ MULTICOLUMN ]
[ 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 <
anBackColor> ]
[ FONTCOLOR <
anFontColor> ]
[ ONGOTFOCUS <
OnGotFocusProcedure> | <bBlock> ]
[ ONCHANGE <
OnChangeProcedure> | <bBlock> ]
[ ONLOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ ONDBLCLICK <
OnDblClickProcedure> | bBlock> ]
[ MULTISELECT < .T. | .F.> ]
[ MULTITAB < .T. | .F. [TABSWIDTH <
aWidth> ] ]
[ MULTICOLUMN < .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.

For MULTITAB style set and get items value may be the array type

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


DESCRIPTION:
nRow, nCol
Position in the area of ??the window in pixels.
nWidth, nHeight
The desired size of the ListBox Control in pixels.
nId
The ID identifier this Control in Dialog Window
ControlName
A reference to the ListBox Control
ParentWindowName
A reference to the Parent Window.
nHelpID
The help topic identifier for this Control
acItems
Specifies the Items list
anValue
Specifies where the cursor highlight will be
cFontName
Specifies the Font Name
nFontSize
Specifies the Font Size
cToolTipText
Specifies the Text for the ToolTip
anBackColor
Specifies the Background Color
anFontColor
Specifies the Font Color
OnGotFocusProcedure
An action to be performed when control Got Focused
OnChangeProcedure
An action to be performed when control value changes
OnLostFocusProcedure
An action to be performed when control Lost Focused
OnDblClickProcedure
An action to be performed when control is Double Clicked
aWidth
Specifies an array of columns width
 
 
MULTISELECT
Specifies that we can select multiple items in the ListBox
MULTICOLUMN
Specifies that we want to setup multiple columns
DRAGITEMS
?
INVISIBLE
The visibility property specifies whether or not a control is visible
NOTABSTOP
Stop the control to receive focus and participate in the tabbing sequence
SORT
Specifies that we want to sort the Items ist in alphabetical order


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
Action to be performed when getting the focus
·   OnChange
Action to be performed when generic changing of the control
Action to be performed when losing the focus.
·   OnDblClick
Action to be performed when Double Left clicking.

METHODS:

·   Show
Shows a ListBox control
·   Hide
Hides a ListBox control
·   Redraw
Redraw a 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
·   SetArray
Set array to the ListBox control
·   GetArray
Get array to the 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)

and sample in Chapter:
More Choices