Tech Tip: Programatically make listbox cells non-enterable
PRODUCT: 4D Write | VERSION: 14.1 | PLATFORM: Mac & Win
Published On: September 3, 2014
In order for a cell in a listbox to be enterable, two conditions must be met:
- The cell's column must be enterable
- The On Before Data Entry event, $0 does not return -1
If the form event On Before Data entry returns -1; the cell will be un-enterable. By default, $0 is 0. The On Before Data entry form event can be used in both the listbox object, and the individual columns inside the listbox.
- If -1 is returned in the On Before Data Entry event within the listbox object, all cells in the listbox will be non-enterable.
- If -1 is return in the On Before Data Entry event within the Column of a listbox, all cells inside the column will be non-enterable
To programmatically make individual cells non-enterable, determine the cell position using LISTBOX GET CELL POSITION. Based off the cell position, set $0 to -1, or 0.
//Listbox object's method Case of :(Form event=On Before Data Entry) LISTBOX GET CELL POSITION(Listbox;$col;$row) If($col=1)&($row=1) //makes the cell in the 1st column, 1st row non-enterable $0:=-1 Else $0:=0 End if End case |