A PictureListBox displays available options or values, which can include pictures. If more options or values exist than can display in the PictureListBox at one time or the text exceeds the width of the PictureListBox, the PictureListBox has one or two (vertical or horizontal) scroll bars.
PictureListBox controls can contain images in the following formats:
-
Bitmaps, with the .BMP extension
-
Icons, with the .CUR extension
-
Cursors, with the .ICO extension
-
GIF files, with the .GIF extension, but not animated GIF files
-
JPEG files, with .JPEG or .JPG extensions
-
Portable Networks Graphics, with .PNG extension
PictureListBox property |
Datatype |
Description |
---|---|---|
Integer |
Specifies the ASCII value of the key you want to assign as the accelerator key for a control. |
|
String |
A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users. |
|
String |
A label that briefly describes the control, such as the text in a button or the name of a menu item. |
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the control is. |
|
Long |
Specifies the numeric value of the background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. |
|
Boolean |
Specifies whether the control has a border. Values are: TRUE -- Control has a border. FALSE -- Control does not have a border. |
|
BorderStyle (enumerated) |
Specifies the style of the border of the control. Values are: StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
Boolean |
Specifies whether PowerBuilder moves the control to the top of the front-to-back order. Values are: TRUE -- Control moved to top. FALSE -- Control not moved to top. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
Boolean |
Specifies behavior of scroll bar. Values are: TRUE -- The scroll bar is always visible, but is disabled when all the items can be accessed without it. FALSE -- The scroll bar is displayed only if it is necessary (based on the number of items and the height of the list box). |
|
Boolean |
Specifies whether PowerBuilder puts the control automatically into Drag mode. Values are: TRUE -- When the control is clicked, the control is automatically in Drag mode. FALSE -- When the control is clicked, the control is not automatically in Drag mode. You have to manually put the control into Drag mode by using the Drag function. |
|
String |
Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control. When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the control is enabled (can be selected). Values are: TRUE -- Control can be selected. FALSE -- Control cannot be selected. |
|
Boolean |
Specifies whether users can select multiple items in the list box at one time. Values are: TRUE -- Users can select multiple items by clicking on an item and dragging the mouse up or down to select items; using Click or Shift+ Click to select a sequential group of items; or using Ctrl+ Click on multiple items. FALSE -- Users cannot select multiple items. Used with MultiSelect The MultiSelect property allows users to select multiple items in a list box by simply clicking on the items. If MultiSelect = true and ExtendedSelect = true, then the behavior of ExtendedSelect takes precedence. |
|
String |
Specifies the name of the typeface in which the text of the control displays (for example, arial or courier). |
|
FontCharSet (enumerated) |
Specifies the font character set used for the text in the control. For a complete list of possible values, see the list of properties for the FontCharSet variable on the Enumerated tab page of the Browser. |
|
FontFamily (enumerated) |
Specifies the font family (type style) used for the text in the control. Values are: AnyFont! Decorative! Modern! Roman! Script! Swiss! |
|
FontPitch (enumerated) |
Specifies the pitch (spacing) of the font used for the text in the control. Values are: Default! Fixed! Variable! |
|
Integer |
Specifies the height of the control, in PowerBuilder units. |
|
Boolean |
Specifies whether a horizontal scroll bar displays. Values are: TRUE -- Horizontal scroll bar displays. FALSE -- Horizontal scroll bar does not display. |
|
Boolean |
Specifies whether the text in the control is italic. Values are: TRUE -- Text is italic. FALSE -- Text is not italic. |
|
String |
Specifies the items in the control. Not updated after initialization. |
|
Integer |
Specifies the picture index for each item in the Item property array. Not updated after initialization. |
|
Boolean |
Specifies whether users can select multiple items in the PictureListBox at one time. Values are: TRUE -- Users can select multiple items. FALSE -- Users cannot select multiple items. Used with ExtendedSelect The MultiSelect property allows users to select multiple items in a list box by simply clicking on the items. If MultiSelect = true and ExtendedSelect = true, then the behavior of ExtendedSelect takes precedence. |
|
Integer |
Specifies height of the picture, in pixels. In a script, this property can be set only when there are no images in the image list. If the value is 0 at the time the first image is added, the size of that image is used to set the size of the rest of the images added. |
|
Long |
Specifies the numeric value of the color to be used to mask user-defined bitmaps added through the initial picture array or with the AddPicture function. System-defined bitmaps know their mask color so this color is ignored. This value is used when a picture is added, and therefore can be changed between AddPicture calls. Values can be: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. |
|
String |
Specifies the names of the files containing the pictures added during initialization. The file extension BMP, ICO, GIF, JPG or JPEG is required. Not updated after initialization. |
|
Integer |
Specifies width of the picture, in pixels. In a script, this property can be set only when there are no images in the image list. If the value is 0 at the time the first image is added, the size of that image is used to set the size of the rest of the images added. |
|
String |
Specifies the name of the stock pointer or the file containing the pointer used for the control. |
|
Boolean |
Specifies that characters should be displayed in right-to-left order. The application must be running on an operating system that supports right-to-left display. Values are: TRUE -- Characters display in right-to-left order. FALSE -- Characters display in left-to-right order. |
|
Boolean |
Specifies whether the items in the PictureListBox are sorted. Values are: TRUE -- Items are sorted. FALSE -- Items are not sorted. |
|
Integer |
Specifies the tab value of the control (0 means the user cannot tab to the control). |
|
Integer array |
Specifies the positions of the tab stops in the PictureListBox. The tab stops are in character positions, and the tab stop delimiter is a space. If you assign a value to only the first tab stop, TabStop[1], the tab stops are equally spaced using the number of character positions specified for the first tab stop. If more than one tab stop is entered, tab stops are located in the positions specified. You can define 16 tab stops in the control; the default array is TabStop[8], with a tab stop every eight character positions. |
|
String |
Specifies the tag value assigned to the control. |
|
Long |
Specifies the numeric value of the color used for text: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. |
|
Integer |
Specifies the size of the text in the control, in points. For backward compatibility, the size is stored as a negative number; for example, 10-point text size is stored as -10. |
|
Boolean |
Specifies whether the text in the control is underlined. Values are: TRUE -- Text is underlined. FALSE -- Text is not underlined. |
|
Boolean |
Specifies whether the control is visible. Values are: TRUE -- Control is visible. FALSE -- Control is not visible. |
|
Boolean |
Specifies whether a vertical scroll bar is displayed on the right of the PictureListBox. Values are: TRUE -- Vertical scroll bar is displayed. FALSE -- Vertical scroll bar is not displayed. |
|
Integer |
Specifies the stroke weight of the text in the control; for example, 400 for normal or 700 for bold. |
|
Integer |
Specifies the width of the control, in PowerBuilder units. |
|
Integer |
Specifies the X position (the distance from the left edge of the window), in PowerBuilder units. |
|
Integer |
Specifies the Y position (the distance from the top of the window), in PowerBuilder units. |
PictureListBox event |
Occurs |
---|---|
Immediately before the Open event occurs in the window |
|
Immediately after the Close event occurs in the window |
|
When the control is double-clicked (selected and activated) |
|
When a dragged control is dropped on the control |
|
When a dragged control enters the control |
|
When a dragged control leaves the control |
|
When a dragged control is within the control |
|
Just before the control receives focus (before it is selected and becomes active) |
|
When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control |
|
When the control loses focus (becomes inactive) |
|
When a Control message occurs that is not a PowerBuilder event |
|
When the right mouse button is pressed on the control |
|
When an item in the control is selected |
PictureListBox function |
Datatype returned |
Description |
---|---|---|
Integer |
Adds a new item to the end of the PictureListBox. If the Sorted property of the control is true, the items are sorted again after the item is added. The AddItem function does not update the Item[ ] or ItemPicture[ ] properties of this control. |
|
Integer |
Adds the bitmap, icon, or cursor file to the main image list. Does not update PictureName[ ]. |
|
String |
Returns the name assigned to the control. |
|
Integer |
Deletes the item indicated by the index from the PictureListBox. |
|
Integer |
Deletes the specified picture from the image list. Does not update PictureName[ ]. |
|
Integer |
Deletes all the pictures from the image list. Does not update PictureName[ ]. |
|
Boolean |
Populates the PictureListBox with a list of the files of the specified type that match the specified file pattern. |
|
Boolean |
Returns the current selection for the control and puts it in the specified variable. |
|
Integer |
Starts or ends the dragging of a control. |
|
Integer |
Finds the first item in the PictureListBox (after the specified index) that begins with the specified string. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Integer |
Makes the control invisible. |
|
Integer |
Adds a new item to the PictureListBox before the item indicated by the index. If the Sorted property of the control is true, the items are sorted again after the item is added. |
|
Integer |
Moves the control to a specified location. |
|
Integer |
Returns the distance of the pointer from the left edge of the control. |
|
Integer |
Returns the distance of the pointer from the top of the control. |
|
Boolean |
Adds an event to the end of the message queue for the control. |
|
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 PictureListBox that is currently selected. If more than one item is selected, it returns the index of the first selected item. |
|
String |
Returns the text of the first selected item. |
|
Integer |
Finds and highlights an item in the control. Use Syntax 1 when you know the text of the item but not its position. Use Syntax 2 when you know the position of the item in the control's list or you want to clear the current selection. SelectItem has no effect on a PictureListBox whose MultiSelect property is true. Instead, use SetState to select items without affecting the selected state of other items in the list. |
|
Integer |
Sets focus to the control. |
|
Integer |
Specifies the position of the control in the front-to-back order of the window. |
|
Integer |
Controls automatic redrawing of the control after each change in its properties. |
|
Integer |
Sets the state (highlighted or not highlighted) of the item indicated by the specified index. SetState works only for multiselect controls (that is, those for which the MultiSelect property is true). |
|
Integer |
Scrolls the items in the control so that the item indicated by the specified index is at the top of the control. |
|
Integer |
Makes the control visible. |
|
Integer |
Returns 1 if the item specified by the specified index is selected (highlighted) and 0 if the item is not selected. |
|
String |
Returns the text of the item in the control that is identified by the specified index. |
|
Integer |
Returns the index number of the item currently at the top of the control. |
|
Integer |
Returns the total number of items in the control. |
|
Integer |
Returns the total number of items selected in the control. |
|
Integer |
Triggers a specified event in the control and executes the script for the event. |
|
Object |
Returns the type of the control. |