记录号 OBJNAME PROPERTIES METHODS 1 2 Dataenvironment Name = "Dataenvironment" 3 Form1 Height = 503 Width = 622 DoCreate = .T. AutoCenter = .T. Caption = "Form1" WindowType = 1 AlwaysOnTop = .T. Name = "Form1" 4 Shape2 Top = 216 Left = 72 Height = 229 Width = 445 Name = "Shape2" 5 Shape1 Top = 43 Left = 72 Height = 121 Width = 444 SpecialEffect = 0 Name = "Shape1" 6 Check1 Top = 60 Left = 96 Height = 16 Width = 45 AutoSize = .T. Caption = "唱歌" Name = "Check1" 7 Check2 Top = 96 Left = 96 Height = 16 Width = 45 AutoSize = .T. Caption = "跳舞" Name = "Check2" 8 Check3 Top = 132 Left = 96 Height = 16 Width = 45 AutoSize = .T. Caption = "乒乓" Name = "Check3" 9 Check4 Top = 96 Left = 192 Height = 16 Width = 45 AutoSize = .T. Caption = "篮球" Name = "Check4" 10 Check5 Top = 132 Left = 192 Height = 16 Width = 69 AutoSize = .T. Caption = "电子游戏" Name = "Check5" 11 Check6 Top = 60 Left = 192 Height = 16 Width = 45 AutoSize = .T. Caption = "足球" Name = "Check6" 12 Edit1 Height = 83 PROCEDURE Init Left = 276 this.value = "您的爱好为"+chr(13) &&chr(13)相 Top = 60 当于回车,起到换行的作用 Width = 216 ENDPROC Name = "Edit1" 13 Label1 AutoSize = .T. PROCEDURE Init Caption = "Label1" this.caption = "选择爱好" Height = 16 ENDPROC Left = 84 Top = 36 Width = 38 Name = "Label1" 14 List1 Height = 181 PROCEDURE RemoveItem Left = 108 LPARAMETERS nIndex MultiSelect = .T. ENDPROC Top = 240 PROCEDURE Init Width = 132 this.rowsourcetype = 1 &&设置列表框的数据源类型为 Name = "List1" 值 this.rowsource= "张三,李四,王五,刘六,马七,张八" &&初始化列表框数据源的值列表 this.selected(1)=.t. ENDPROC PROCEDURE DblClick *此代码段的功能是:当双击list1(左边的列表框)中的 某一行的项目时,就将其移动到list2列表框中去 *并根据移动项目后可能出现的情况进行判断,让某些按 钮禁用或者启用 thisform.list2.additem(this.list(this.listindex)) &&在右边列表框中增加当前(左列表框)双击的项目 this.removeitem(this.listindex) &&移去双击的项目,实现项目减少 if this.listcount = 0 && 如果当前左列表框中的项目没有了, thisform.command1.enabled = .f. &&左边空了 ,就将右移和全右移的按钮设置为禁用 thisform.command3.enabled = .f. else thisform.command2.enabled = .t. &&左边空了 ,就将左移和全左移的按钮设置为启用 thisform.command4.enabled = .t. endif ENDPROC 15 List2 Height = 181 Left = 324 Top = 240 Width = 132 Name = "List2" 16 Command1 Top = 245 PROCEDURE Click Left = 252 *此段代码功能:实现左边列表框项目右移 Height = 32 Width = 60 if thisform.list1.listindex = 0 &&如果没有项 Caption = ">" 目选中,则默认第一个 Name = "Command1" thisform.list1.selected(1)=.t. endif thisform.list2.additem(thisform.list1.list(thisfor m.list1.listindex)) &&将左边列表框当前选中的项目 ,添加到右边列表框的末尾 thisform.list1.removeitem(thisform.list1.listindex ) &&将刚刚添加的项目移除,相当 于上边的是右移动功能 thisform.list1.selected(1)=.t. &&将左边列表框的第一项设置为选中状态 thisform.command2.enabled =.t. &&当前动作完成后,右移项目后,右边列表框至少有一个 项目,让右移按钮功能启用 if thisform.list1.listcount = 0 this.enabled = .f. thisform.list2.selected(1)=.t. endif ENDPROC 17 Command2 Top = 281 PROCEDURE Init Left = 252 this.enabled =.f. Height = 32 ENDPROC Width = 60 PROCEDURE Click Caption = "<" *此段代码功能:实现右边列表框项目左移 Name = "Command2" if thisform.list2.listindex = 0 &&如果没有项 目选中,则默认第一个 =messagebox("没有选中任何信息",0) return endif thisform.list1.additem(thisform.list2.list(thisfor m.list2.listindex)) &&将右边列表框当前选中的项目 ,添加到左边列表框的末尾 thisform.list2.removeitem(thisform.list2.listindex ) &&将刚刚添加的项目移除,相当于上边的是左移动功 能 thisform.list2.selected(1)=.t. &&将右边列表框 的第一项设置为选中状态 thisform.command1.enabled =.t. &&当前动作完成 后,左移项目后,左边列表框至少有一个项目,让左移按 钮功能启用 if thisform.list2.listcount = 0 &&判断左边项目 后,右边列表框项目总数为0了,即已经没有项目了 this.enabled = .f. &&禁用左移按钮 thisform.list1.selected(1)=.t. &&设置左移项目 后,右边列表框目总数为0了,左边列表框第一项选中 endif ENDPROC 18 Command3 Top = 317 PROCEDURE Click Left = 252 for i=thisform.list1.listcount to 1 step -1 Height = 32 thisform.list2.additem(thisform.list1.list(i)) Width = 60 thisform.list1.removeitem(i) Caption = ">>|" endfor Name = "Command3" thisform.command2.enabled =.t. thisform.command4.enabled =.t. thisform.command1.enabled =.f. thisform.command3.enabled =.f. ENDPROC 19 Command4 Top = 353 PROCEDURE Click Left = 252 for i=thisform.list2.listcount to 1 step -1 Height = 32 thisform.list1.additem(thisform.list2.list(i)) Width = 60 thisform.list2.removeitem(i) Caption = "|<<" endfor Name = "Command4" thisform.command1.enabled =.t. thisform.command3.enabled =.t. thisform.command2.enabled =.f. thisform.command4.enabled =.f. ENDPROC PROCEDURE Init this.enabled =.f. ENDPROC 20 Command5 Top = 389 PROCEDURE Click Left = 252 nr="" Height = 32 if thisform.list2.listcount<>0 Width = 60 for i=1 to thisform.list2.listcount Caption = "OK" nr = nr + thisform.list2.list(i) + Name = "Command5" chr(13) endfor thisform.edit1.value = "你选择的人员如下: "+ chr(13) + nr else =messagebox("没有选择任何人员",0,"提示") endif ENDPROC PROCEDURE RightClick thisform.command6.visible = .t. ENDPROC 21 Combo1 Height = 25 PROCEDURE InteractiveChange Left = 72 *本代码段的功能是:判断当前下拉列表框的值发改变, Style = 2 则将班级值写入Edit1对象中 Top = 180 if this.listindex>1 &&下拉列表框的第一项,显示的是 Width = 108 提示信息,所以应该过滤掉 ItemTips = .T. thisform.edit1.value = this.value &&写入 DisplayCount = 5 Edit1中 Name = "Combo1" endif ENDPROC PROCEDURE Init this.rowsourcetype = 1 this.rowsource="选择班级,微机109班,微机110班,微机 111班,微机112班,微机113班,建筑47班,建筑48班,建筑 49班,建筑50班" this.displayvalue = 1 ENDPROC 22 Command6 Top = 180 PROCEDURE Init Left = 192 this.visible = .f. &&设置运行初始状态, Height = 25 此对象不可见 Width = 108 this.caption = '提交内容' &&此按钮对象的标题为 Caption = "Command6" :提交内容 Name = "Command6" ENDPROC PROCEDURE Click ah = '' &&建立爱好变量 bj = '' &&建立班级变量 ry = '' &&建立人员变量 for i = 1 to 6 &&分别读取复选框1-6的被 选中的复选框的标题,累加到ah这个变量里 chk = allt(str(i)) if thisform.check&chk..value = 1 ah = ah + thisform.check&chk..caption + "、 " endif endfor if len(ah)=0 =messagebox("没有选择爱好",0,"提示") return endif if thisform.combo1.listindex >0 bj = thisform.combo1.value &&读取下拉列表 框当前被选中的值,保存到bj这个变量里 else =messagebox("没有选择班级",0,'提示') return endif for i=1 to thisform.list2.listcount ry = ry + thisform.list2.list(i)+spac(1) endfor if len(ry)=0 =messagebox("没有选择人员",0,"提示") return endif thisform.edit1.value = "你选择的爱好为:"+ah +chr(13)+ "的有【" +bj + "】的如下人员:" + chr(13)+ ry ENDPROC 23 Label2 AutoSize = .T. PROCEDURE Init Caption = "Label1" this.caption = "选择人员" Height = 16 ENDPROC Left = 456 Top = 210 Width = 38 Name = "Label2" 24 宋体, 0, 9, 6, 14, 10, 12, 2, 2