[サンプルコード]
Form Form1 {
X = 0;
Y = 0;
Width = 400;
Height = 300;
/* スプレッドに表示されている行数 */
Number Row_Num = 5;
TextBox TextBox1 {
X = 15;
Y = 10;
Width = 100;
Height = 25;
}
Button Button1 {
X = 125;
Y = 10;
Width = 150;
Height = 25;
Title = "指定行を先頭行にする";
Function OnTouch( e ) {
var r = ^.TextBox1.Value + ^.Row_Num;
if( ( 0 > ^.TextBox1.Value )
|| ( ^.TextBox1.Value > ^.Spread1.SpreadRow1.length - 1) ) {
MessageBox( "0から" + str(^.Spread1.SpreadRow1.length - 1)
+ "の範囲で指定してください");
return;
}
if ( r > ^.Spread1.SpreadRow1.length) {
r = ^.Spread1.SpreadRow1.length;
}
^.Spread1.SetScrollPos( r );
SetTimer( 0.1 );
}
Function OnTimer( e ) {
RemoveTimer();
^.Spread1.SetScrollPos( ^.TextBox1.Value );
^.Spread1.Value = ^.TextBox1.Value;
}
}
Spread Spread1 {
X = 15;
Y = 50;
Width = 360;
Height = 145;
ShowNumber = $FALSE;
SpreadRow SpreadRow1[20] {
Height = 25;
SpreadColumn SpreadColumn1 {
Value &= Str(^.index) + "行";
}
SpreadColumn SpreadColumn2;
SpreadColumn SpreadColumn3;
}
}
if ( !$DESIGNTIME ) {
}
}
|