VB课程设计滚动字幕代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Private Sub Check2_Click()
If Check2.Value = 1 Then Form2.WindowState = 2
End Sub
Private Sub Combo1_Click()
If Combo1.ListIndex = 0 Then Form1.BackColor = vbBlue
If Combo1.ListIndex = 1 Then Form1.BackColor = vbBlack
If Combo1.ListIndex = 2 Then Form1.BackColor = vbRed
If Combo1.ListIndex = 3 Then Form1.BackColor = vbYellow End Sub
Private Sub Combo2_Click()
If Combo2.ListIndex = 0 Then bel1.ForeColor = vbBlue
If Combo2.ListIndex = 1 Then bel1.ForeColor = vbRed
If Combo2.ListIndex = 2 Then bel1.ForeColor = vbGreen If Combo2.ListIndex = 3 Then bel1.ForeColor = vbYellow End Sub
Private Sub Command1_Click()
bel1.FontName = "宋体"
End Sub
Private Sub Command10_Click()
bel1.Caption = "勤奋学习"
End Sub
Private Sub Command11_Click()
bel1.Caption = "团结友爱"
End Sub
Private Sub Command12_Click()
bel1.Caption = "认真学习"
End Sub
Private Sub Command13_Click()
Unload Form1
End Sub
Private Sub Command14_Click()
Form2.Show
End Sub
Private Sub Command15_Click()
Unload Form1
Unload Form2
End Sub
Private Sub Command2_Click()
bel1.FontName = "隶书"
End Sub
Private Sub Command3_Click()
bel1.FontName = "楷体"
End Sub
Private Sub Command4_Click()
bel1.FontName = "黑体"
End Sub
Private Sub Command5_Click()
bel1.Caption = "你好"
End Sub
Private Sub Command6_Click()
bel1.Caption = "学如逆水行舟,不进则退" End Sub
Private Sub Command7_Click()
bel1.Caption = "书中自有黄金屋" End Sub
Private Sub Command8_Click()
bel1.Caption = "今天的天气是······" End Sub
Private Sub Command9_Click()
bel1.Caption = "请同学注意好身体"
End Sub
Private Sub Form_Load()
Form1.Caption = "流动字幕板"
Form2.Caption = "流动字木板"
End Sub
Private Sub Option2_Click()
bel1.FontSize = 30
End Sub
Private Sub Option1_Click()
bel1.FontSize = 60
End Sub
Private Sub Text1_Change()
Text1.Text = Text1.Text
bel1.Caption = Text1.Text
End Sub
Private Sub Timer1_Timer() '从右往左穿透式
If Check1.Value = 1 Then
Randomize Timer
bel1.ForeColor = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)) Form1.BackColor = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255))
End If
End Sub
Private Sub Timer2_Timer() '左到右穿透式
If Option3.Value = True Then
bel1.Left = bel1.Left + HScroll1.Value If bel1.Left >= Form2.Width Then
bel1.Left = bel1.Width
End If
End If
End Sub
Private Sub Timer3_Timer() '壁面反射(未成功)