Files
SDL/SDL/mdm/frmDatumsabfrage.vb

51 lines
1.5 KiB
VB.net

Imports GrapeCity.Viewer.Common.Model
Imports VERAG_PROG_ALLGEMEIN
Public Class frmDatumsabfrage
Dim onlypastDate As Boolean = True
Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
End Sub
Sub New(title As String, _onlypastDate As Boolean)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
onlypastDate = _onlypastDate
lbl.Text = title
End Sub
Public Datum As Date = CDate(Now.ToShortDateString)
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn.Click
Label1.Text = ""
If onlypastDate And CDate(dtp_date.Value) > CDate(Now.ToShortDateString) Then
Label1.Text = "Muss heute oder früher sein!"
Me.DialogResult = DialogResult.None
Exit Sub
End If
Datum = CDate(dtp_date.Value)
Me.DialogResult = DialogResult.OK
End Sub
Private Sub dtp_date_KeyDown(sender As Object, e As KeyEventArgs) Handles dtp_date.KeyDown
If e.KeyCode = Keys.Return Then
btn.PerformClick()
End If
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Datum = CDate(Now.ToShortDateString)
Me.Close()
End Sub
Private Sub frmDatumsabfrage(sender As Object, e As EventArgs) Handles Me.Load
dtp_date.Value = Now.ToShortDateString
End Sub
End Class