一段简单的代码可总是提示
不能在改上下文中卸载
Private Sub Combo1_Click()
Dim i For i = UboundL To 1 Step -1
MsgBox "i=" & i
Unload Label3(i)'此处提示不能在改上下文中卸载
Unload Text1(i)
Unload Text2(i)
Next iFor i = 1 To Val(Combo1.Text) - 1
Load Label3(i)
Label3(i).Left = Label3(i - 1).Left + Label3(0).Width + 300
Label3(i).Visible = True
Load Text1(i)
Text1(i).Left = Text1(i - 1).Left + Text1(0).Width + 225
Text1(i).Visible = True
Load Text2(i)
Text2(i).Left = Text2(i - 1).Left + Text2(0).Width + 225
Text2(i).Visible = True Next i
UboundL = Label3.UBound
MsgBox UboundL用coomand 调用卸载则能正常卸载,combo能正常加载
??????
不能在改上下文中卸载
Private Sub Combo1_Click()
Dim i For i = UboundL To 1 Step -1
MsgBox "i=" & i
Unload Label3(i)'此处提示不能在改上下文中卸载
Unload Text1(i)
Unload Text2(i)
Next iFor i = 1 To Val(Combo1.Text) - 1
Load Label3(i)
Label3(i).Left = Label3(i - 1).Left + Label3(0).Width + 300
Label3(i).Visible = True
Load Text1(i)
Text1(i).Left = Text1(i - 1).Left + Text1(0).Width + 225
Text1(i).Visible = True
Load Text2(i)
Text2(i).Left = Text2(i - 1).Left + Text2(0).Width + 225
Text2(i).Visible = True Next i
UboundL = Label3.UBound
MsgBox UboundL用coomand 调用卸载则能正常卸载,combo能正常加载
??????
打错字了 还有command
把For i = 1 To Val(Combo1.Text) - 1
换成For i = 1 To Val(text1.Text) - 1
也能正常加载、卸载,就combo不行
郁闷
什么原因呢?
我只卸载text和label啊?另,按你的说法command不也是控件吗?
Unload Text1
End Sub这算什么...