@...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.
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:
Set / Gets ListBox value.
| |
Set / Gets enabled state of a ListBox control
| |
Set / Gets visible a ListBox control.
| |
Set / Gets item text in a ListBox
| |
Get item count in a ListBox
| |
Set / Gets row position of a ListBox control.
| |
Set / Gets column position of a ListBox control.
| |
Set / Gets width of a ListBox control.
| |
Set / Gets height of a ListBox control.
| |
Set / Gets ListBox control's font name.
| |
Set / Gets ListBox control's font size.
| |
Set / Gets ListBox control's font bold property
| |
Set / Gets ListBox control's font italic property
| |
Set / Gets ListBox control's font underline property
| |
Set / Gets ListBox control's font strikeout property
| |
Set / Gets the foreground color for text within the ListBox
| |
Set / Gets the background color for text within the ListBox
| |
Set / Gets ListBox control's tooltip text.
| |
Set / Gets user property 'Cargo' for ListBox control
| |
Retrieves the name of a ListBox control.
| |
Set the name as character identifier of the parent window.
| |
Set the numeric help topic identifier of the control.
| |
Sets whether an element behavior can't receive focus and participate
in the tabbing sequence
| |
Sets a value indicating whether multiple items can be selected
| |
Specifies whether the items in a ListBox can be arranged by the user.
| |
Sets to automatically sort strings alphabetically in a ListBox
| |
Control passes to the statement that follows the terminated
statement.
|
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 losing the focus.
| |
Action to be performed when Double Left clicking.
|
METHODS:
Shows a ListBox control
| |
Hides a ListBox control
| |
Redraw a Control
| |
Add a new item to a ListBox control
| |
Deletes an item from a ListBox control
| |
Deletes all items from a ListBox control
| |
Gives the focus to a ListBox control
| |
Set array to the ListBox control
| |
Get array to the ListBox control
| |
Releases a ListBox control from memory
| |
Save a ListBox control as BitMap file.
|
EXAMPLE: