ListBox control
A ListBox displays available options or values. If more options or
values exist than can display in the ListBox at one time or the text
exceeds the width of the ListBox, the ListBox has one or two (vertical or
horizontal) scroll bars.
Properties
|
ListBox property |
Datatype |
Description |
|---|---|---|
|
Integer |
Specifies the ASCII value of the key you want to |
|
|
String |
A description of the control and/or its purpose for |
|
|
String |
A label that briefly describes the control, such as |
|
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the |
|
|
Long |
Specifies the numeric value of the background |
|
|
Boolean |
Specifies whether the control has a border. Values TRUE — Control has a border. FALSE |
|
|
BorderStyle (enumerated) |
Specifies the style of the border of the control. StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
|
Boolean |
Specifies whether PowerBuilder moves the control to TRUE FALSE — Control not moved |
|
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing |
|
Boolean |
Specifies behavior of a scroll bar. Values TRUE — The scroll bar is always visible but is FALSE — The scroll bar is displayed only if it |
|
|
Boolean |
Specifies whether PowerBuilder puts the control TRUE — FALSE — When the control is clicked, the |
|
|
String |
Specifies the name of the stock icon or the file When the user drags the control, the |
|
|
Boolean |
Specifies whether the control is enabled (can be TRUE — Control can be FALSE — Control cannot be |
|
|
Boolean |
Specifies whether users can select multiple items TRUE — FALSE — Users cannot Used with The MultiSelect property allows users to |
|
|
String |
Specifies the name of the typeface in which the |
|
|
FontCharSet (enumerated) |
Specifies the font character set used for the text |
|
|
FontFamily (enumerated) |
Specifies the font family (type style) used for the AnyFont! Decorative! Modern! Roman! Script! Swiss! |
|
|
FontPitch (enumerated) |
Specifies the pitch (spacing) of the font used for Default! Fixed! Variable! |
|
|
Integer |
Specifies the height of the control, in |
|
|
Boolean |
Specifies whether a horizontal scroll bar displays. TRUE — Horizontal scroll bar FALSE — Horizontal scroll bar does not |
|
|
Boolean |
Specifies whether the text in the control is TRUE — Text is FALSE — Text is not italic. |
|
|
String |
Specifies the items in the control. |
|
|
Boolean |
Specifies whether users can select multiple items TRUE — FALSE — Users Used with The MultiSelect property allows users |
|
|
String |
Specifies the name of the stock pointer or the file |
|
|
Boolean |
Specifies that characters should be displayed in TRUE — Characters display in right-to-left FALSE — Characters display in left-to-right |
|
|
Boolean |
Specifies whether the items in the ListBox are TRUE — Items are FALSE — Items are not |
|
|
Integer |
Specifies the tab value of the control (0 means the |
|
|
Integer array |
Specifies the positions of the tab stops in the |
|
|
String |
Specifies the tag value assigned to the |
|
|
Long |
Specifies the numeric value of the color used for |
|
|
Integer |
Specifies the size of the text in the control, in |
|
|
Boolean |
Specifies whether the text in the control is TRUE — Text is FALSE — Text is not |
|
|
Boolean |
Specifies whether the control is visible. Values TRUE — Control is visible. FALSE |
|
|
Boolean |
Specifies whether a vertical scroll bar is TRUE — Vertical scroll bar is FALSE — Vertical scroll bar is not |
|
|
Integer |
Specifies the stroke weight of the text in the |
|
|
Integer |
Specifies the width of the control, in PowerBuilder |
|
|
Integer |
Specifies the X position (the distance from the |
|
|
Integer |
Specifies the Y position (the distance from the top |
Events
|
ListBox event |
Occurs |
|---|---|
|
Immediately before the Open event occurs in the |
|
|
Immediately after the Close event occurs in the |
|
|
When the control is double-clicked (selected and |
|
|
When a dragged control is dropped on the |
|
|
When a dragged control enters the |
|
|
When a dragged control leaves the |
|
|
When a dragged control is within the |
|
|
Just before the control receives focus (before it |
|
|
When the user presses the F1 key or drags the |
|
|
When the control loses focus (becomes |
|
|
When a Controls message occurs that is not a |
|
|
When the right mouse button is pressed on the |
|
|
When an item in the control is |
Functions
|
ListBox function |
Datatype returned |
Description |
|---|---|---|
|
Integer |
Adds a new item to the end of the ListBox. If the The AddItem function |
|
|
String |
Returns the name assigned to the |
|
|
Integer |
Deletes the item indicated by the index from the |
|
|
Boolean |
Populates the ListBox with a list of the files of |
|
|
Boolean |
Returns the current selection for the control and |
|
|
Integer |
Starts or ends the dragging of a |
|
|
Integer |
Finds the first item in the ListBox (after the |
|
|
Integer |
Creates a reference to a context-specific instance |
|
|
PowerObject |
Returns a reference to the name of the parent |
|
|
Integer |
Makes the control invisible. |
|
|
Integer |
Adds a new item to the ListBox before the item |
|
|
Integer |
Moves the control to a specified |
|
|
Integer |
Returns the distance of the pointer from the left |
|
|
Integer |
Returns the distance of the pointer from the top of |
|
|
Boolean |
Adds an event to the end of the message queue for |
|
|
Integer |
Prints the control. |
|
|
Integer |
Removes all items from the control. |
|
|
Integer |
Changes the size of the control. |
|
|
Integer |
Returns the index of the item in the ListBox that |
|
|
String |
Returns the text of the first selected |
|
|
Integer |
Finds and highlights an item in the control. Use SelectItem has no effect on a ListBox |
|
|
Integer |
Sets focus to the control. |
|
|
Integer |
Specifies the position of the control in the |
|
|
Integer |
Controls automatic redrawing of the control after |
|
|
Integer |
Sets the state (highlighted or not highlighted) of |
|
|
Integer |
Scrolls the items in the control so that the item |
|
|
Integer |
Makes the control visible. |
|
|
Integer |
Returns 1 if the item specified by the specified |
|
|
String |
Returns the text of the item in the control |
|
|
Integer |
Returns the index number of the item currently at |
|
|
Integer |
Returns the total number of items in the |
|
|
Integer |
Returns the total number of items selected in the |
|
|
Integer |
Triggers a specified event in the control and |
|
|
Object |
Returns the type of the control. |