API version 1

- ‐

RW

integer

value

最後に選択した項目の配列番号を示します。

-1は非選択状態を示します。

各選択肢の選択状態は各アイテムのCheckItem.selectedプロパティで取得してください。

初期値は-1です。

関連項目

CheckItem.selectedプロパティ



使用例 CRSダウンロード

Form CheckBox {
   x = 0;
   y = 0;
   width = 800;
   height = 600;
   CheckBox checkbox1 {
           x = 24;
           y = 32;
           width = 128;
           height = 48;
           UseChange = true;
           threeState = false;
           CheckItem CheckItem1[2] {
                   height = 20;
                   for (var i=0;i<this.length;i++) {
                           this[i].Title = "Item["+str(i)+"]";
                           this[i].value = i;
                   }
                   Function OnTouch( e ) {
                           ^.^.TextBox2.Value = ^.^.checkbox1.CheckItem1[0].Selected;
                           ^.^.TextBox3.Value = ^.^.checkbox1.CheckItem1[1].Selected;
                   }
           }
           Function OnChange( e ) {
                   ^.TextBox1.Value = ^.checkbox1.value;
           }

   }
   CheckBox checkbox2 {
           x = 24;
           y = 136;
           width = 128;
           height = 48;
           UseChange = true;
           threeState = true;
           CheckItem CheckItem1[2] {
                   height = 20;
                   for (var i=0;i<this.length;i++) {
                           this[i].Title = "Item["+str(i)+"]";
                           this[i].value = i;
                   }

                   Function OnTouch( e ) {
                           ^.^.TextBox7.Value = ^.^.checkbox2.CheckItem1[0].Selected;
                           ^.^.TextBox8.Value = ^.^.checkbox2.CheckItem1[1].Selected;
                   }
           }
           Function OnChange( e ) {
                   ^.TextBox6.Value = ^.checkbox2.value;
           }
   }

   Label label1 {
           x = 24;
           y = 16;
           width = 104;
           height = 16;
           title = "threeState = false";
   }
   Label label2 {
           x = 24;
           y = 120;
           width = 120;
           height = 16;
           title = "threeState = true";
   }

   TextBox TextBox1 {
           x = 112;
           y = 88;
           Width = 30;
           Height = 20;
           value = ^.checkbox1.Value;
   }

   TextBox TextBox2 {
           x = 168;
           y = 32;
           Width = 30;
           Height = 20;
           Value = ^.checkbox1.CheckItem1[0].selected;
   }

   TextBox TextBox3 {
           x = 168;
           y = 56;
           Width = 30;
           height = 18;
           Value = ^.checkbox1.CheckItem1[1].selected;
   }
   TextBox TextBox6 {
           x = 112;
           y = 192;
           Width = 30;
           Height = 20;
           value = ^.checkbox2.Value;
   }

   TextBox TextBox7 {
           x = 168;
           y = 136;
           Width = 30;
           Height = 20;
           Value = ^.checkbox2.CheckItem1[0].selected;
   }

   TextBox TextBox8 {
           x = 168;
           y = 160;
           Width = 30;
           Height = 20;
           Value = ^.checkbox2.CheckItem1[1].selected;
   }
}