'--------------------------------------------------- ' VBScript Ver5のクラスを利用した ' イベントのハンドル '--------------------------------------------------- ' クラスを生成する dim obj set obj = new mainframe '---------------------------------------------------- ' メインフレームの生成とイベントをうけるクラスの定義 class mainframe public instance public sub class_initialize set instance = createobject("seraphyscripttools.instance") with instance.mainframe .classobject = me .domodal end with end sub public sub OnClick dim x,y with instance.mainframe with .event x = .posx y = .posy end with with .canvas.layer(0) .fillcircle x,y,5 end with .draw end with end sub public sub OnMouseMove dim x,y with instance.mainframe with .event x = .posx y = .posy end with with .canvas.layer(1) .clear .setmappingmode 1 .text 0,0,x & "/" & y .setmappingmode 0 .line 0,y,999,y .line x,0,x,999 end with .draw end with end sub end class