下面的代码怎样简化关于列表框的
请教各位高手:下面的代码怎样简化? 谢谢!!!
我是刚刚想学习VB6编程的,遇到一些困难,想请教高手指点。
在窗口中添加一个CommandButton按钮,添加二十六个CheckBox复选框,还有添加一个ListBox列表框,
在CommandButton按钮填入下面的代码
Private Sub Command1_Click()
If Check1.Value = 1 Then List1.AddItem Check1.Caption
If Check2.Value = 1 Then List1.AddItem Check2.Caption
If Check3.Value = 1 Then List1.AddItem Check3.Caption
If Check4.Value = 1 Then List1.AddItem Check4.Caption
If Check5.Value = 1 Then List1.AddItem Check5.Caption
If Check6.Value = 1 Then List1.AddItem Check6.Caption
If Check7.Value = 1 Then List1.AddItem Check7.Caption
If Check8.Value = 1 Then List1.AddItem Check8.Caption
If Check9.Value = 1 Then List1.AddItem Check9.Caption
If Check10.Value = 1 Then List1.AddItem Check10.Caption
If Check11.Value = 1 Then List1.AddItem Check11.Caption
If Check12.Value = 1 Then List1.AddItem Check12.Caption
If Check13.Value = 1 Then List1.AddItem Check13.Caption
If Check14.Value = 1 Then List1.AddItem Check14.Caption
If Check15.Value = 1 Then List1.AddItem Check15.Caption
If Check16.Value = 1 Then List1.AddItem Check16.Caption
If Check17.Value = 1 Then List1.AddItem Check17.Caption
If Check18.Value = 1 Then List1.AddItem Check18.Caption
If Check19.Value = 1 Then List1.AddItem Check19.Caption
If Check20.Value = 1 Then List1.AddItem Check20.Caption
If Check21.Value = 1 Then List1.AddItem Check21.Caption
If Check22.Value = 1 Then List1.AddItem Check22.Caption
If Check23.Value = 1 Then List1.AddItem Check23.Caption
If Check24.Value = 1 Then List1.AddItem Check24.Caption
If Check25.Value = 1 Then List1.AddItem Check25.Caption
If Check26.Value = 1 Then List1.AddItem Check26.Caption
End Sub
还有一个问题请教高手
我在一个工程中创建两个窗口,每个窗口都添加一个ListBox列表框,
怎样才能把窗口1中ListBox列表框的内容放到窗口2中的ListBox列表框里。
谢谢!!!高手