[サンプルコード]
Form Form1 {
X = 0;
Y = 0;
Width = 325;
Height = 202;
Button Button1 {
X = 148;
Y = 31;
Width = 137;
Height = 38;
Title = "黄色い背景は?";
Function OnTouch( e ) {
var ca = ^.GetChildObjects();
for (var i in ca){
if( ca[i].classname == "Label" ) {
/* 背景(BgColor) が 黄色 のオブジェクトか判断 */
if( ca[i].BgColor == $FFFFCC ) {
messagebox(ca[i].value);
}
}
}
}
}
Label Label1 {
X = 30;
Y = 19;
Width = 78;
Height = 16;
Value = "Label1";
VerticalAlign = $CENTER;
HorizontalAlign = $CENTER;
BgColor = $FFCCCC;
}
Label Label2 {
X = 30;
Y = 61;
Width = 78;
Height = 16;
Value = "Label2";
VerticalAlign = $CENTER;
HorizontalAlign = $CENTER;
BgColor = $FFFFCC;
}
Label Label3 {
X = 30;
Y = 101;
Width = 78;
Height = 16;
Value = "Label3";
VerticalAlign = $CENTER;
HorizontalAlign = $CENTER;
BgColor = $CCFFCC;
}
Label Label4 {
X = 30;
Y = 139;
Width = 78;
Height = 16;
Value = "Label4";
VerticalAlign = $CENTER;
HorizontalAlign = $CENTER;
BgColor = $CCCCFF;
}
}
|