Public Class Today_Change
    Private Sub btnTodayOK_Click(sender As Object, e As EventArgs) Handles btnTodayOK.Click
        Dim st_Date As Date
        Dim en_Date As Date

        st_Date = nud_st_year.Text & "-" & nud_st_month.Text & "-" & nud_st_day.Text
        en_Date = nud_en_year.Text & "-" & nud_en_month.Text & "-" & nud_en_day.Text

        If DateDiff(DateInterval.Day, st_Date, en_Date) < 0 Then
            MsgBox("시작 날짜가 끝 날짜보다 큽니다." + vbCrLf + "날짜를 다시 지정하여 주십시오.", vbCritical)
        Else
            MainForm.lbStDate.Text = st_Date
            MainForm.lbEnDate.Text = en_Date
            Me.Close()
        End If
    End Sub

    Private Sub btnTodayCC_Click(sender As Object, e As EventArgs) Handles btnTodayCC.Click
        Me.Close()
    End Sub

    Private Sub Today_Change_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim date_data As String
        nud_st_year.Text = Mid(MainForm.lbStDate.Text, 1, InStr(1, MainForm.lbStDate.Text, "-") - 1)
        date_data = Mid(MainForm.lbStDate.Text, InStr(1, MainForm.lbStDate.Text, "-") + 1, MainForm.lbStDate.Text.Length)
        nud_st_month.Text = Mid(date_data, 1, InStr(1, date_data, "-") - 1)
        date_data = Mid(date_data, InStr(1, date_data, "-") + 1, date_data.Length)
        nud_st_day.Text = Mid(date_data, 1, date_data.Length)

        nud_en_year.Text = Mid(MainForm.lbEnDate.Text, 1, InStr(1, MainForm.lbEnDate.Text, "-") - 1)
        date_data = Mid(MainForm.lbEnDate.Text, InStr(1, MainForm.lbEnDate.Text, "-") + 1, MainForm.lbEnDate.Text.Length)
        nud_en_month.Text = Mid(date_data, 1, InStr(1, date_data, "-") - 1)
        date_data = Mid(date_data, InStr(1, date_data, "-") + 1, date_data.Length)
        nud_en_day.Text = Mid(date_data, 1, date_data.Length)
    End Sub
End Class