VB编程:Enum创建包含12个月的枚举类型
运行效果:
程序代码:
Option Explicit
Public Enum Month
jan = 1
feb = 2
mar = 3
apr = 4
may = 5
jun = 6
jul = 7
aug = 8
sep = 9
Oct = 10
nov = 11
dec = 12
End Enum
Private Sub Form_Load()
Text1.Text = Month.jan & "月份" _
& Month.jan & "月份" _
& Month.feb & "月份" _
& Month.mar & "月份" _
& Month.apr & "月份" _
& Month.may & "月份" _
& Month.jun & "月份" _
& Month.jul & "月份" _
& Month.aug & "月份" _
& Month.sep & "月份" _
& Month.Oct & "月份" _
& Month.nov & "月份" _
& Month.dec & "月份"
End Sub
编写总结:
“ _”=>>“空格下划线”,续行符。类似于英文中的连字符。