neu
This commit is contained in:
@@ -12,6 +12,7 @@ Public Class MyTextBox
|
||||
Property _ShortDateNew As Boolean = False
|
||||
Property _DateTimeOnly As Boolean = False
|
||||
Property _TimeOnly As Boolean = False
|
||||
Property _TimeOnly_Seconds As Boolean = False
|
||||
Property _Waehrung As Boolean = False
|
||||
Property _WaehrungZeichen As Boolean = True
|
||||
Property _Prozent As Boolean = False
|
||||
@@ -331,6 +332,18 @@ Public Class MyTextBox
|
||||
If Not isShortDate(sender.text) Then sender.ForeColor = System.Drawing.Color.Red
|
||||
End If
|
||||
|
||||
If _TimeOnly Then
|
||||
If Me.Text <> "" AndAlso IsNumeric(Me.Text) AndAlso CInt(Me.Text) >= 0 AndAlso CInt(Me.Text) < 24 Then
|
||||
pruefungHandled = True
|
||||
If _TimeOnly_Seconds Then
|
||||
Me.Text &= ":00:00"
|
||||
Else
|
||||
Me.Text &= ":00"
|
||||
End If
|
||||
OnPropertyChanged("_value")
|
||||
End If
|
||||
End If
|
||||
|
||||
If _ShortDateNew Then
|
||||
pruefungHandled = True
|
||||
Me.ForeColor = Color.Black
|
||||
@@ -344,6 +357,10 @@ Public Class MyTextBox
|
||||
End If
|
||||
End If
|
||||
|
||||
' +2 = zwei Tage von heute weg
|
||||
If Me.Text <> "" AndAlso Not IsDate(Me.Text) AndAlso IsNumeric(Me.Text) Then
|
||||
Me.Text = Now.AddDays(Int(Me.Text)).ToShortDateString
|
||||
End If
|
||||
If (Me.Text.Length >= 6 And Me.Text.Length <= 10) AndAlso IsDate(Me.Text.Replace(",", ".")) AndAlso CDate(Me.Text) > CDate("01.01.1900") Then
|
||||
'MsgBox(Me.Text)
|
||||
''------ falls Jahr zweistellig:
|
||||
@@ -454,8 +471,12 @@ Public Class MyTextBox
|
||||
pruefungHandled = True
|
||||
Me.ForeColor = Color.Black
|
||||
If Me.Text.Length = 10 AndAlso IsDate(Me.Text.Replace(",", ".")) AndAlso CDate(Me.Text) > CDate("01.01.1900") Then
|
||||
Me._value = CDate(Me.Text).ToShortDateString 'Nur wenns Passt
|
||||
Me.Text = CDate(Me.Text).ToShortDateString
|
||||
Try
|
||||
Me._value = CDate(Me.Text).ToShortDateString 'Nur wenns Passt
|
||||
Me.Text = CDate(Me.Text).ToShortDateString
|
||||
Catch ex As Exception
|
||||
sender.ForeColor = System.Drawing.Color.Red
|
||||
End Try
|
||||
ElseIf Me.Text = "" Then
|
||||
Me._value = ""
|
||||
Else
|
||||
@@ -645,13 +666,22 @@ Public Class MyTextBox
|
||||
Me.Text = Me.Text.Replace("/", ":")
|
||||
Dim regTime1 As New System.Text.RegularExpressions.Regex("^([0-1][0-9]|[2][0-3]):([0-5][0-9])$")
|
||||
Dim regTime2 As New System.Text.RegularExpressions.Regex("^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$")
|
||||
If regTime1.IsMatch(sender.Text) Then
|
||||
Me.Text += ":00"
|
||||
End If
|
||||
If regTime2.IsMatch(sender.Text) Then
|
||||
e.Cancel = False
|
||||
If _TimeOnly_Seconds Then
|
||||
|
||||
If regTime1.IsMatch(sender.Text) Then
|
||||
Me.Text += ":00"
|
||||
End If
|
||||
If regTime2.IsMatch(sender.Text) Then
|
||||
e.Cancel = False
|
||||
Else
|
||||
e.Cancel = True
|
||||
End If
|
||||
Else
|
||||
e.Cancel = True
|
||||
If regTime1.IsMatch(sender.Text) Then
|
||||
e.Cancel = False
|
||||
Else
|
||||
e.Cancel = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If e.Cancel Then
|
||||
|
||||
Reference in New Issue
Block a user