lbCurSel: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *S([a-z ])" to "$1 - s$2")
 
(66 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.75


|1.5|= Game version
|game2= ofpe
|version2= 1.00


|arg= local |= Arguments in MP
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| Returns the index of the selected item of the listbox or combobox with id idc of the topmost user [[dialog]]. |= Description
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| '''lbCurSel ''idc''''' |= Syntax
|game5= arma2oa
|version5= 1.50


|p1= idc: [[Number]] |= Parameter 1
|game6= tkoh
|version6= 1.00


| [[Number]] |= Return value
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50
 
|x1= <pre>_index = lbCurSel 101</pre> |= Example 1
____________________________________________________________________________________________


| |= See also
|gr1= GUI Control - ListBox


|descr= Returns the index of the selected item of the [[CT_LISTBOX]], [[CT_LISTNBOX]], [[CT_COMBO]] or [[CT_TOOLBOX]]. For [[CT_LISTBOX]] with multi selection enabled use [[lbSelection]].
|s1= [[lbCurSel]]  idc
|p1= idc: [[Number]]
|r1= [[Number]] - selected index (row) or -1 if nothing is selected
|s2= [[lbCurSel]]  control
|p21= control: [[Control]]
|r2= [[Number]] - selected index (row) or -1 if nothing is selected
|x1= <sqf>_index = lbCurSel 101;</sqf>
|x2= <sqf>lbCurSel _ctrl;</sqf>
|seealso= [[lbIsSelected]] [[lbSelection]] [[lbSetCurSel]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
<dt></dt>
<dd class="notedate">Posted: Sep 10 2014</dd>
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt>
<dd class="note">More information on the [[CT_LISTBOX]] command family can be found [[CT_LISTBOX#Scripting_Example|here]].
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|LBCURSEL]]
[[Category:Scripting Commands OFP 1.96|LBCURSEL]]
[[Category:Scripting Commands ArmA|LBCURSEL]]

Latest revision as of 15:49, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns the index of the selected item of the CT_LISTBOX, CT_LISTNBOX, CT_COMBO or CT_TOOLBOX. For CT_LISTBOX with multi selection enabled use lbSelection.
Groups:
GUI Control - ListBox

Syntax

Syntax:
lbCurSel idc
Parameters:
idc: Number
Return Value:
Number - selected index (row) or -1 if nothing is selected

Alternative Syntax

Syntax:
lbCurSel control
Parameters:
control: Control
Return Value:
Number - selected index (row) or -1 if nothing is selected

Examples

Example 1:
_index = lbCurSel 101;
Example 2:
lbCurSel _ctrl;

Additional Information

See also:
lbIsSelected lbSelection lbSetCurSel

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
Posted: Sep 10 2014
ffur2007slx2_5
More information on the CT_LISTBOX command family can be found here.