| 发表于:2007-03-03 15:00:364楼 得分:10 |
测试环境准备 text1(0) text1(1) text2(0) text2(1) text3(0) text3(1) command(0)====增加 command(1)===减少 增加一个class 名字为class1 代码如下 option explicit public sub funtxt1(i as integer, view as boolean) dim intx as integer for intx = 0 to i - 1 form1.text1(intx).visible = view next end sub public sub funtxt2(i as integer, view as boolean) dim intx as integer for intx = 0 to i - 1 form1.text2(intx).visible = view next end sub public sub funtxt3(i as integer, view as boolean) dim intx as integer for intx = 0 to i - 1 form1.text3(intx).visible = view next end sub 窗体代码如下 option explicit dim intadd as integer dim intdec as integer private sub command1_click(index as integer) dim myclass as new class1 select case index case 0 call callbyname(myclass, "funtxt " & intadd, vbmethod, 2, true) intadd = (intadd + 1) if intadd = 4 then intadd = 1 case 1 call callbyname(myclass, "funtxt " & intdec, vbmethod, 2, false) intdec = (intdec - 1) if intadd = -1 then intadd = 3 end select end sub private sub form_load() dim i as integer for i = 0 to 1 text1(i).visible = false text2(i).visible = false text3(i).visible = false next intadd = 1 intdec = 3 end sub 经过调试!!!!! | | |
|