请教高手:怎样为程序添加的控件写事件
class表中有课程内容:语文、数学、科学、英语等等,字段名为lesson_name,动态添加的checkbox控件生成后,如何为控件添加click事件?SELECT lesson
COPY TO array c_lesson fiel lesson_name for !EMPTY(lesson_name)
s_len = ALEN(c_lesson)
c_top = 100
c_left = 18
k = 1
FOR i = 1 to s_len
IF i = 4 then
k = 1
c_top = c_top + 20
ENDIF
str = 'checkbox'+ ALLTRIM(STR(i))
thisform.addobject( str,'checkbox')
with thisform.&str
.top = c_top
.left = c_left + k * 100
.autosize = .t.
.caption = c_lesson(i)
.visible=.t.
.click
ENDWITH
k = k + 1
ENDFOR