Jump to content
7erra

_ctrl lbSetCurSel -1

Recommended Posts

Hi,

I was creating a dialog with a combo and was using the lbSetCurSel command. Apparently the BIKI is not entirely correct because it states

Quote

To deselect all, use -1: _ctrl lbSetCurSel -1;

https://community.bistudio.com/wiki/lbSetCurSel

 

There is one note which seems interesting:

Quote

 

Prior to ArmA 1.90 lbSetCurSel -1 had no effect while the listbox was populated. You needed to use lbClear first, then lbSetCurSel -1, then re-populate the listbox.

~ @dreadedentity,  November 29, 2014

 

It looks like this behaviour only applies to Listboxes (CT_LISTBOX) but not Combos (CT_COMBO). Instead when selecting the "-1st" entry it selects the 0th.

 

So here's the question: Has anyone got an idea how to deselect a combo entry (ideally without clearing it)?

Share this post


Link to post
Share on other sites
_ctrl lbSetCurSel _ind;

This one. Referencing a control only by it's IDC might lead to interferences with other controls with the same IDC.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×