vb 七个label框依次出现相隔0.1秒 全都出现后重新开始 怎么做到
1个回答
展开全部
动态新建和删除控件,添加一个command和timer
Option Base 1
Dim label(10) As label
Dim i As Integer
Private Sub Command1_Click()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If i = 10 Then Call qc
i = i + 1
Set label(i) = Me.Controls.Add("VB.label", "label" & i) '动态创建控件
With label(i) '为控件属性赋值
.Left = 500 * i
.Top = 500
.Caption = i
.AutoSize = True
.Visible = True
End With
End Sub
Sub qc()
Dim a As Integer
i = 0
For a = 1 To 10
Controls.Remove label(a)
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询