VB工程17--百例25--古诗测试

前端之家收集整理的这篇文章主要介绍了VB工程17--百例25--古诗测试前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Option Explicit

Private Sub Combo1_Click()
Select Case Combo1.Text
Case "李白"
Label3.Caption = "望庐山瀑布" & Chr(13) & Chr(13) & "日照香炉生紫烟," _
& Chr(13) & Chr(13) & "遥看瀑布挂前川。" _
& Chr(13) & Chr(13) & "飞流直下三千尺," & _
Chr(13) & Chr(13) & "疑是银河落九天

Chr(13)是空格的意思,chr(13)&chr(13)是连续空两行的意思

"编写代码,想要空行的方法1.按空格2.按住shift同时按住减号3.enter进行错行
Case "杜甫"
Label3.Caption = "绝句" & Chr(13) & Chr(13) & "两只黄鹂鸣翠柳," _
& Chr(13) & Chr(13) & "一行白鹭上青天。" _
& Chr(13) & Chr(13) & "窗含西岭千秋雪," _
& Chr(13) & Chr(13) & "门泊东吴万里船。"
End Select
End Sub
Private Sub Form_Load()
Combo1.AddItem "李白"
Combo1.AddItem "杜甫"
End Sub

原文链接:https://www.f2er.com/vb/260435.html

猜你在找的VB相关文章