2012-09-19 28 views
0

我有一個(int)掩碼字段,其中包含selectlist的選定值。
文檔:MaskField
我有一個字符串數組,它對應於maskfield的條目。Maskfield選定值

填充此maskfield後,我想要檢索我的數組中選擇wehere選項。
如何用這個int來做到這一點?

回答

1

我發現如何做到這一點:

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 
    } 
}