lbAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (template:command argument fix)
Line 13: Line 13:
| Adds an item with the given text to the listbox or combobox with id idc of the topmost user [[dialog]].
| Adds an item with the given text to the listbox or combobox with id idc of the topmost user [[dialog]].
<br>
<br>
It returns the index of the newly added item. |= Description
It returns the index of the newly added item. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[Number]] <nowiki>=</nowiki> '''lbAdd''' [idc, text] |= Syntax
| [[Number]] <nowiki>=</nowiki> '''lbAdd''' [idc, text] |SYNTAX=


|p1= [idc, text]: [[Array]] |= Parameter 1
|p1= [idc, text]: [[Array]] |PARAMETER1=
|p2= idc: [[Number]] of control |= Parameter 2
|p2= idc: [[Number]] of control |PARAMETER2=
|p3= text: [[String]] |= Parameter 3
|p3= text: [[String]] |PARAMETER3=


| [[Number]] |= Return value
| [[Number]] |RETURNVALUE=




|s2= control '''lbAdd''' text |= Syntax
|s2= control '''lbAdd''' text |SYNTAX=


|p21= control: [[Control]] |= Parameter 1
|p21= control: [[Control]] |PARAMETER1=
|p22= text: [[String]] |= Parameter 2
|p22= text: [[String]] |PARAMETER2=


|r2= [[Number]] |= Return value
|r2= [[Number]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>_index = [[lbAdd]] [101, "First item"];</code> |= Example 1
|x1= <code>_index = [[lbAdd]] [101, "First item"];</code> |EXAMPLE1=


|x2= <code>_index = _control [[lbAdd]] "First item";</code> |= Example 2
|x2= <code>_index = _control [[lbAdd]] "First item";</code> |EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[lbClear]], [[lbColor]], [[lbCurSel]], [[lbData]], [[lbDelete]], [[lbIsSelected]], [[lbPicture]], [[lbSelection]], [[lbSetColor]], [[lbSetCurSel]], [[lbSetData]], [[lbSetPicture]], [[lbSetSelected]], [[lbSetTooltip]], [[lbSetValue]], [[lbSize]], [[lbSort]], [[lbSortByValue]], [[lbText]], [[lbValue]] |= See also
| [[lbClear]], [[lbColor]], [[lbCurSel]], [[lbData]], [[lbDelete]], [[lbIsSelected]], [[lbPicture]], [[lbSelection]], [[lbSetColor]], [[lbSetCurSel]], [[lbSetData]], [[lbSetPicture]], [[lbSetSelected]], [[lbSetTooltip]], [[lbSetValue]], [[lbSize]], [[lbSort]], [[lbSortByValue]], [[lbText]], [[lbValue]] |SEEALSO=


}}
}}

Revision as of 14:42, 7 April 2019

Hover & click on the images for description

Description

Description:
Adds an item with the given text to the listbox or combobox with id idc of the topmost user dialog.
It returns the index of the newly added item.
Groups:
Uncategorised

Syntax

Syntax:
Number = lbAdd [idc, text]
Parameters:
[idc, text]: Array
idc: Number of control
text: String
Return Value:
Number

Alternative Syntax

Syntax:
control lbAdd text
Parameters:
control: Control
text: String
Return Value:
Number

Examples

Example 1:
_index = lbAdd [101, "First item"];
Example 2:
_index = _control lbAdd "First item";

Additional Information

See also:
lbClearlbColorlbCurSellbDatalbDeletelbIsSelectedlbPicturelbSelectionlbSetColorlbSetCurSellbSetDatalbSetPicturelbSetSelectedlbSetTooltiplbSetValuelbSizelbSortlbSortByValuelbTextlbValue

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted: Sep 10 2014
ffur2007slx2_5
More information on the LB command family can be found here

Bottom Section

Posted on April 12, 2015 - 11:01 (UTC)
IT07
This command can be very very frustrating to use because it does not output any errors if unable to function.
Often, the 2nd provided syntax needs to be used like this:
_giveYourControlAname = (findDisplay 7) displayCtrl 9; _addThisToListBox = "Option"; _giveYourControlAname lbAdd _addThisToListBox; Where "7" is the "idd" of the dialog you made in your ".hpp" file and where "9" is the "idc" of the RscListBox or RscComboBox.
The code above will add an option named "Option" to the ListBox or ComboBox.