📄 form1.vb
字号:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents MonthCalendar1 As System.Windows.Forms.MonthCalendar
Friend WithEvents Button6 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Button1 = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.Button2 = New System.Windows.Forms.Button
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.ListBox1 = New System.Windows.Forms.ListBox
Me.Button5 = New System.Windows.Forms.Button
Me.MonthCalendar1 = New System.Windows.Forms.MonthCalendar
Me.Button6 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 24)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(472, 48)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Label1"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(304, 72)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(184, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "某年第几个节气的日期"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 80)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(32, 23)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Year"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(88, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(32, 23)
Me.Label3.TabIndex = 3
Me.Label3.Text = "Term"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(40, 80)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(40, 21)
Me.TextBox1.TabIndex = 4
Me.TextBox1.Text = "2007"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(120, 80)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(56, 21)
Me.TextBox2.TabIndex = 5
Me.TextBox2.Text = "1"
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(40, 120)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(40, 21)
Me.TextBox3.TabIndex = 6
Me.TextBox3.Text = "1"
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(40, 152)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(40, 21)
Me.TextBox4.TabIndex = 7
Me.TextBox4.Text = "1"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(88, 152)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 8
Me.Button2.Text = "节日"
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(304, 120)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.TabIndex = 9
Me.TextBox5.Text = "0202世界湿地日"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(304, 152)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 10
Me.Button3.Text = "Button3"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(8, 184)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(200, 23)
Me.Button4.TabIndex = 11
Me.Button4.Text = "判断某日是否为二十四节气"
'
'ListBox1
'
Me.ListBox1.ItemHeight = 12
Me.ListBox1.Location = New System.Drawing.Point(8, 216)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(120, 280)
Me.ListBox1.TabIndex = 12
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(168, 152)
Me.Button5.Name = "Button5"
Me.Button5.TabIndex = 13
Me.Button5.Text = "星座"
'
'MonthCalendar1
'
Me.MonthCalendar1.Location = New System.Drawing.Point(136, 216)
Me.MonthCalendar1.Name = "MonthCalendar1"
Me.MonthCalendar1.SelectionRange = New System.Windows.Forms.SelectionRange(New Date(2007, 12, 8, 0, 0, 0, 0), New Date(2007, 12, 14, 0, 0, 0, 0))
Me.MonthCalendar1.TabIndex = 14
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(88, 120)
Me.Button6.Name = "Button6"
Me.Button6.TabIndex = 15
Me.Button6.Text = "农历"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(520, 509)
Me.Controls.Add(Me.Button6)
Me.Controls.Add(Me.MonthCalendar1)
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim gtoc As New GtoC
Me.Label1.Text = gtoc.GetiTermDay(Me.TextBox1.Text, Me.TextBox2.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim strdate As Date = CType(Me.TextBox1.Text + "-" + Me.TextBox3.Text + "-" + Me.TextBox4.Text, Date)
Dim gtoc As New GtoC
Me.Label1.Text = gtoc.JeiRi(strdate)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim str As String = Me.TextBox5.Text
Me.Label1.Text = str.Substring(4, str.Length - 4)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim gtoc As New GtoC
Me.Label1.Text = gtoc.GetiTerm(CType(Me.TextBox1.Text + "-" + Me.TextBox3.Text + "-" + Me.TextBox4.Text, Date), Me.TextBox2.Text)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim xz As New Xingzhuo
Me.Label1.Text = xz.XingZhuo(CType(Me.TextBox1.Text + "-" + Me.TextBox3.Text + "-" + Me.TextBox4.Text, Date), True)
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
End Sub
Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
Dim nl As New GtoC
Me.Label1.Text = nl.Gtoc(Me.MonthCalendar1.SelectionStart)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -