KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to detect a click or double-click beyond the last row of data in a List Box
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: July 25, 2013

It is a nice feature to detect user clicks beyond the end of the last row of data in a List Box and give the user some type of feedback, such as adding a new record or row of data if the user double-clicks in this area. The code snippet below shows how to detect a click or double-click beyond the last row of data in a List Box.

LISTBOX GET CELL POSITION(*;"myListForm";$Col;$Row)
If($Row=0)
    // Click or double-click beyond the last row of data
    // Do something...


End if


The command LISTBOX GET CELL POSITION will return the column the user clicked in but if it is beyond the last row of data the row value will be zero.