Gets a handle (pointer) to listbox listboxName.
Parameters:
Name |
Type |
Value |
Description |
listboxName |
String |
name |
ScreenFieldName of the listbox to set the number of columns. Ctrl+Click onto a listbox to retrieve its listboxName (= ScreenFieldName). |
Returns:
Type |
Value |
Description |
Integer |
0 - n |
Returns a handle (pointer) to the listbox listboxName.
Hint: If we loop through all rows of a listbox to operate on the contents of cells, we prefer to make use of a handle (pointer) to a listbox. When we use methods with the listbox name as a parameter, the listbox has to be searched in every single iteration of a loop. This can slow down the operation. For an example on how to work with ListGetHandle, see example below. |
Integer |
-1 |
An error occurred. A handle to the listbox listboxName could not be retrieved. |
Available in:
WindowMain |
WindowLink |
YES |
YES |
Used in:
XojoScript Name |
GUID |
Calculate total participation fee for current attendee |
F0F802CC-D151-4F59-A749-1E232527D0C2 |
Calculate seminar participation fee |
2F6CFC74-44AB-4956-A760-BBD5E57595E8 |
Create Seminar Invoice in Word |
D2036EFA-D283-481A-9A93-D00547680749 |
Calculate participation fee for seminar attendee |
032B50D3-D463-453E-9370-9AF7C34DA1D5 |
Add a Payment for Event participation |
877AA389-2167-4A95-904E-95C6329A2BFD |
Delete seminar participation payment |
FBE87F41-596E-4C04-BB74-1B9A8FA21FEF |
Hint: You can find references to XojoScripts which make use of this function by sending the following SQL statement to the database:
Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%ListGetHandle%'
Example XojoScript:
// WindowLink.imSB_lnk_p02_Recalc, Recalc Total Payments
CalcTotal
Sub CalcTotal()
Dim lbHandle As Integer = ListGetHandle("imLB_lnk_p01_PaymentList")
Dim numRows As Integer = ListCount(lbHandle)
Dim totalPaid As Double = 0.0
If numRows > 0 Then
For i As Integer = 0 to numRows-1
totalPaid = totalPaid + Val(ListGetCell(lbHandle,i,2))
Next
End IF
SetText("imTF_lnk_p01_TotalPaid",Format(totalPaid,"-#####0.00"))
End Sub