- Home /
Maskfield selected values
I have a mask field, filed with strings (Array).
The selection returns an int as the documentation says : MaskField
How can I get the selected values in my string array using this int ?
Thanks a lot.
Comment
Best Answer
Answer by MaT227 · Sep 19, 2012 at 02:09 PM
I found how to do it :
ArrayList maGroupNames; // This is my array of options (string)
int mCategory; // This is my maskfield's result
for (int i = 0; i < maGroupNames.Count; i++)
{
int layer = 1 << i;
if ((mCategory & layer) != 0)
{
//This group is selected
}
}