vb求代码

来源:百度知道 编辑:UC知道 时间:2024/06/02 16:19:16
Private Sub Command1_Click()
Static n As Integer

If n <> 0 Then Load Label1(n)
Label1(n).Move 100, 200 + n * 500
Label1(n).Visible = True
n = n + 1
End Sub
这样每点一次,就在form上添加一个label
现在我想实现这功能
command点一次后,在tab0上添加一个label
command点2次后,在tab1上添加一个label
command点3次后,在tab12上添加一个label,以此类推

Private Sub Command1_Click()
Static n As Integer

If n <> 0 Then Load Label1(n)
Label1(n).Move 100, 200 + n * 500
Label1(n).Visible = True
n = n + 1

if n mod 3 =0 then
set Label1(n).Container =tab2
else n mod 2=0 then
set Label1(n).Container =tab1
else
set Label1(n).Container =tab0
end if

End Sub