KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility method that selects and scrolls to a List Box row
PRODUCT: 4D | VERSION: 12.5 | PLATFORM: Mac & Win
Published On: April 5, 2013

This Technical Tip provides a utility method that selects and scrolls to a List Box row. The method is created specifically for 4D v12 and v13.

   // Method: ListBox_GoToRow
   // Parameters
   // $1 - Pointer to a List Box variable
   // $2 - Element to select in the List Box
   // ----------------------------------------------------


C_POINTER($1;$listbox_p)
C_LONGINT($2;$row_l)

If (Count parameters>=2)
  $listbox_p:=$1
  $row_l:=$2

  If ($row_l>0)
    LISTBOX SELECT ROW($listbox_p->;$row_l)
    OBJECT SET SCROLL POSITION($listbox_p->;$row_l)
  End if

End if