4D v16.3

LISTBOX Get information

Home

 
4D v16.3
LISTBOX Get information

LISTBOX Get information 


 

LISTBOX Get information ( {* ;} object ; info ) -> Function result 
Parameter Type   Description
Operator in If specified, object is an object name (string). If omitted, object is a variable
object  Form object in Object name (if * is specified) or Variable (if * is omitted)
info  Longint in Information to get
Function result  Longint in Current value

The LISTBOX Get information command returns various information regarding the current visibility and size of headers, footers 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 pass a variable reference instead of a string. For more information about object names, refer to the Object Properties section.

In the 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:

Constant Type Value Comment
lk display footer Longint 8 Display Footers property
Applies to: List box
Possible values:
  • lk no (0): hidden
  • lk yes (1): shown
lk display header Longint 0 Display Headers property
Applies to: List box
Possible values:
  • lk no (0): hidden
  • lk yes (1): shown
lk display hor scrollbar Longint 2 0=hidden, 1=shown
lk display ver scrollbar Longint 4 0=hidden, 1=shown
lk footer height Longint 9 Height in pixels
lk header height Longint 1 Height in pixels
lk hor scrollbar height Longint 3 Height in pixels
lk hor scrollbar position Longint 6 Position of the cursor in pixels
lk ver scrollbar position Longint 7 Position of the cursor in pixels
lk ver scrollbar width Longint 5 Width in pixels
  • The first constants are useful for calculating the actual size of a list box area in a form.
  • When you use the constants lk hor scrollbar position or lk ver scrollbar position, the LISTBOX Get 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.
  • The statement LISTBOX Get information(vLB;lk footer height) returns the same value as the LISTBOX Get footers height command when footers are displayed. However, if footers are not displayed, LISTBOX Get information returns 0 while LISTBOX Get footers height still returns the height, in this case theoretical, of the footers.

Example  

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

 $scroll:=LISTBOX Get information(*;"Listbox";lk ver scrollbar position)

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 

LISTBOX SET GRID
OBJECT SET SCROLLBAR

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 917

 
HISTORY 

Modified: 4D 2004.1
Renamed: 4D v12
Modified: 4D v13

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)