Get listbox information

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2004.1 (Modified)


Get listbox information ({*; }object; info) Longint

ParameterTypeDescription
*If specified, object is an object name (string)
If omitted, object is a variable
objectForm objectObject name (if * is specified) or
Variable (if * is omitted)
infoLongintInformation to get
Function resultLongintCurrent value

Description

The Get listbox information command returns various information regarding the current visibility and size of headers and scrollbars in the list box object set using the object and * parameters.

If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a variable. In this case, you do not pass a string, but a variable reference. For more information about object names, refer to the Object Properties section.

In the dans info parameter, pass a value indicating the type of information that you want to get. You can use a value or one of the following constants from the "List box" theme:

ConstantTypeValueReturned value(s)
Display listbox headerLongint00=hidden, 1=shown
Listbox header heightLongint1Height in pixels
Display listbox hor scrollbarLongint20=hidden, 1=shown
Listbox hor scrollbar height Longint3Height in pixels
Display listbox ver scrollbarLongint40=hidden, 1=shown
Listbox ver scrollbar widthLongint5Width in pixels
Position listbox hor scrollbarLongint6Position of the cursor in pixels
Position listbox ver scrollbarLongint7Position of the cursor in pixels

The first six constants are useful for calculating the actual size of a list box area in a form.

When you use the constants Position listbox hor scrollbar or Position listbox ver scrollbar, the Get listbox information command returns the position of the scrolling cursor in relation to its original position, i.e. the size of the hidden part of the window, expressed in pixels. By default, this position corresponds to 0. Combined, for example, with information concerning the row height, this value lets you find out the contents displayed in the listbox.

Example

Given a list box containing rows with a height of 20 pixels each. You execute the following statement:

   $scroll:=Get listbox information(*;"Listbox";Position listbox ver scrollbar)

If, for instance, $scroll returns 200, you can conclude that the 11th row is currently the first one displayed in the list box (200/20=10, thus 10 rows are hidden).

See Also

SET SCROLLBAR VISIBLE, SHOW LISTBOX GRID.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next