KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Going programmatically to a specific element a listbox
PRODUCT: 4D | VERSION: 2004.1 | PLATFORM: Mac & Win
Published On: March 10, 2005

Here is a simple method that will highlight the element in a listbox based on a given element position. It will also scroll down to the target element when the element is below or above the visible list area.

` Method: SelectListboxElement
` $1 - Listbox Object Name
` $2 - Target Position
C_TEXT($1;$lbName_t)
C_LONGINT($2;$Position_l)
$lbName_t:=$1
$Position_l:=$2
SELECT LISTBOX ROW(*;$lbName_t;$Position_l;Replace listbox selection )
SCROLL LINES(*;$lbName_t;$Position_l)