VB窗体横向中心加一行从右到左循环移动的文字
答案:2 悬赏:60
解决时间 2021-03-14 16:15
- 提问者网友:梧桐不渝
- 2021-03-14 05:43
VB窗体横向中心加一行从右到左循环移动的文字
最佳答案
- 二级知识专家网友:晚安听书人
- 2021-03-14 06:00
''两个标签设为同一控62616964757a686964616fe78988e69d8331333332623261件组,别为Label1(0),Label1(1),
Private Sub Form_Load()
Me.WindowState = 2
Me.BackColor = RGB(0, 255, 255)
For i = 0 To 1
Label1(i).AutoSize = True
Label1(i).BackStyle = 0
Label1(i).Left = Me.Width / 2 - Label1(i).Width / 2
Label1(i).FontSize = 60
Label1(i).Caption = "我们欢迎你"
Next
Timer1.Interval = 20
Timer1.Enabled = True
End Sub
Private Sub Form_Resize()
If Me.Height > Label1(0).Height Then
Label1(0).Top = Me.Height / 2 - Label1(0).Height / 2
Label1(1).Top = Me.Height / 2 - Label1(1).Height / 2
End If
End Sub
Private Sub Timer1_Timer()
For i = 0 To 1
If Label1(i).Left < 0 Then
Label1(1 - i).Left = Me.Width + Label1(i).Left
End If
Label1(i).Left = Label1(i).Left - 50
Next
End Sub
Private Sub Form_Load()
Me.WindowState = 2
Me.BackColor = RGB(0, 255, 255)
For i = 0 To 1
Label1(i).AutoSize = True
Label1(i).BackStyle = 0
Label1(i).Left = Me.Width / 2 - Label1(i).Width / 2
Label1(i).FontSize = 60
Label1(i).Caption = "我们欢迎你"
Next
Timer1.Interval = 20
Timer1.Enabled = True
End Sub
Private Sub Form_Resize()
If Me.Height > Label1(0).Height Then
Label1(0).Top = Me.Height / 2 - Label1(0).Height / 2
Label1(1).Top = Me.Height / 2 - Label1(1).Height / 2
End If
End Sub
Private Sub Timer1_Timer()
For i = 0 To 1
If Label1(i).Left < 0 Then
Label1(1 - i).Left = Me.Width + Label1(i).Left
End If
Label1(i).Left = Label1(i).Left - 50
Next
End Sub
全部回答
- 1楼网友:厌今念往
- 2021-03-14 06:31
使用控件数组,复制picture1,后面在窗体内粘贴,想要多少,粘多少。可得:picture1(0),picture1(1)......
private sub timer1_timer()
for i = picture1.lbound to picture1.ubound
if picture1(i).left > me.width then
picture1(i).left = -picture1(i).width
else
picture1(i).left = picture1(i).left + 500
end if
next i
end sub
private sub form_load()
timer1.interval = 200
timer1.enabled = true
for i = picture1.lbound to picture1.ubound
picture1(i).left = i * (picture1(i).width + 30)
next i
end sub
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |