API version 1

- ‐

RW

integer

value

現在選択されているリスト項目の配列番号です。

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

初期値は-1です。

関連項目

OptionItem.selected プロパティ



使用例 CRSダウンロード

Form OptionBI {
   X = 0;
   Y = 0;
   Width = 765;
   Height = 494;

   Label Label19 {
           x = 38;
           y = 206;
           Width = 127;
           Height = 18;
           Value = "【エラー情報等】";
   }
   EditBox EditBox1 {
           x = 38;
           y = 226;
           Width = 305;
           Height = 114;
   }
   Button Button11 {
           x = 347;
           y = 229;
           Width = 72;
           Height = 26;
           Title = "Clear";

           Function OnTouch( e ) {
                   ^.EditBox1.Clear();
           }
   }

   OptionButton obj {
           x = 37;
           y = 48;
           Width = 103;
           Height = 71;
           TabIndex = 1;

           OptionItem OptionItem1[3] {
                   try {
                           Height = 20;

                           for (var i = 0; i < 3; i++) {
                                   this[i].title = "Item[" + str(i) + "]";;
                                   this[i].value = i;
                           }
                   } catch (e) {
                           ^.^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
                   Function OnTouch( e ) {
                           try {
                                   OptionBI.Label14.value = OptionBI.obj.OptionItem1[0].selected;
                                   OptionBI.Label15.value = OptionBI.obj.OptionItem1[1].selected;
                                   OptionBI.Label16.value = OptionBI.obj.OptionItem1[2].selected;
                           } catch (e) {
                           ^.^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                           }
                   }
           }
           Function OnChange( e ) {
                   try {
                           OptionBI.Label13.Value = OptionBI.obj.value;
                   } catch (e) {
                           ^.^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
           }
   }
   Label Label9 {
           x = 154;
           y = 190;
           Width = 150;
           Height = 15;
           Value = "OptionButton.Value = ";
   }
   Label Label10 {
           x = 272;
           y = 29;
           width = 158;
           Height = 15;
           Value = "OptionItem.Selected";
   }
   TextBox Label13 {
           x = 295;
           y = 182;
           Width = 71;
           Height = 24;
           value &= OptionBI.obj.Value;
   }
   TextBox Label14 {
           x = 291;
           y = 50;
           Width = 72;
           Height = 24;
           value = OptionBI.obj.OptionItem1[0].selected;
   }
   TextBox Label15 {
           x = 291;
           y = 75;
           Width = 72;
           Height = 24;
           value = OptionBI.obj.OptionItem1[1].selected;
   }
   TextBox Label16 {
           x = 291;
           y = 100;
           Width = 72;
           Height = 24;
           value = OptionBI.obj.OptionItem1[2].selected;
   }
   Label Label24 {
           x = 168;
           y = 29;
           width = 95;
           Height = 18;
           Value = "ボタンで選択";
   }

   Button Button1 {
           x = 158;
           y = 50;
           Width = 111;
           Height = 24;
           title = "item[0]";
           Function OnTouch( e ) {
                   try {
                           OptionBI.obj.Value = 0;
                   } catch (e) {
                           ^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
           }
   }
   Button Button2 {
           x = 158;
           y = 75;
           Width = 111;
           Height = 24;
           title = "item[1]";
           Function OnTouch( e ) {
                   try {
                           OptionBI.obj.Value = 1;
                   } catch (e) {
                           ^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
           }
   }
   Button Button3 {
           x = 158;
           y = 100;
           Width = 111;
           Height = 24;
           title = "item[2]";
           Function OnTouch( e ) {
                   try {
                           OptionBI.obj.Value = 2;
                   } catch (e) {
                           ^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
           }
   }
   Button Button4 {
           x = 158;
           y = 125;
           Width = 111;
           Height = 24;
           title = "未選択";
           Function OnTouch( e ) {
                   try {
                           OptionBI.obj.Value = -1;
                   } catch (e) {
                           ^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
           }
   }
   Button Button5 {
           x = 158;
           y = 150;
           Width = 111;
           Height = 24;
           title = "-2を設定";

           Function OnTouch( e ) {
                   try {
                           OptionBI.obj.Value = -2;
                   } catch (e) {
                           ^.EditBox1.Value = "Message=" + str(e.Message) + "\r\nCategory=" + str(e.Category) + "\r\nCode="+ str(e.Code)  + "\r\nSubCode=" + str(e.subCode);
                   }
           }
   }
}