展开全部
Private Sub Command1_Click()
Dim i As Long
Dim r As Long
Dim a(1 To 20) As Long
List1.Clear
Randomize
For i = 1 To 6
Do
r = Int(Rnd * 20 + 1)
Loop Until a(r) <= 2
a(r) = a(r) + 1
List1.AddItem r
Next
List1.AddItem vbNullString
For i = 1 To 20
If a(i) > 0 Then
List1.AddItem i & "出现了" & a(i) & "次; "
End If
Next
End Sub
Dim i As Long
Dim r As Long
Dim a(1 To 20) As Long
List1.Clear
Randomize
For i = 1 To 6
Do
r = Int(Rnd * 20 + 1)
Loop Until a(r) <= 2
a(r) = a(r) + 1
List1.AddItem r
Next
List1.AddItem vbNullString
For i = 1 To 20
If a(i) > 0 Then
List1.AddItem i & "出现了" & a(i) & "次; "
End If
Next
End Sub
博思aippt
2024-07-20 广告
2024-07-20 广告
博思AIPPT是基于ai制作PPT的智能在线工具,它提供了4种AI制作PPT的方式,包括AI生成大纲、AI直接生成PPT、文本生成PPT、AI提炼文档生成PPT,一站式集成多种AI生成PPT的方式,可满足办公用户的不同需求和使用场景。ai生...
点击进入详情页
本回答由博思aippt提供
展开全部
添加一个timer控件 一个label控件
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 50
Label1.AutoSize = True
Label1.Caption = "欢迎使用vb"
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 50
If Label1.Left > Me.Width Then
Label1.Left = -Label1.Width
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 50
Label1.AutoSize = True
Label1.Caption = "欢迎使用vb"
End Sub
Private Sub Timer1_Timer()
Label1.Left = Label1.Left + 50
If Label1.Left > Me.Width Then
Label1.Left = -Label1.Width
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询