3个回答
展开全部
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 广告
作为深圳市博思云创科技有限公司的工作人员,对于Word文档生成PPT的操作,我们有以下建议:1. 使用另存为功能:在Word中编辑完文档后,点击文件->另存为,选择PowerPoint演示文稿(*.pptx)格式,即可将文档内容转换为PPT...
点击进入详情页
本回答由博思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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询