neu
This commit is contained in:
@@ -121,6 +121,10 @@ Public Class KdSearchBox
|
||||
e.Handled = True
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If kdNrField IsNot Nothing Then kdNrField.Text = ""
|
||||
|
||||
KdNr_value = -1
|
||||
@@ -174,12 +178,13 @@ Public Class KdSearchBox
|
||||
usrcntl.Height = usrcntlHEIGHT
|
||||
|
||||
Dim locationOnForm As Point = Nothing
|
||||
If dgvpos = "LEFT" Or dgvpos = "" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
ElseIf dgvpos = "RIGHT" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
locationOnForm.X = locationOnForm.X - (usrcntl.Width - Me.Width)
|
||||
' MsgBox(locationOnForm.X & "/" & locationOnForm.Y)
|
||||
If Me.FindForm IsNot Nothing Then
|
||||
If dgvpos = "LEFT" Or dgvpos = "" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
ElseIf dgvpos = "RIGHT" Then
|
||||
locationOnForm = Me.FindForm().PointToClient(Me.Parent.PointToScreen(Me.Location))
|
||||
locationOnForm.X = locationOnForm.X - (usrcntl.Width - Me.Width)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,9 @@ Public Class MyComboBox
|
||||
Function changeItem(v, Optional Valueallowed = False) As Boolean
|
||||
'
|
||||
Try
|
||||
|
||||
If v Is Nothing Then Me.Text = "" : Return True
|
||||
If v Is DBNull.Value Then Me.Text = "" : Return True
|
||||
If Me.Items.Count = 0 Then Me.Text = "" : Return True
|
||||
|
||||
If Me.Items(0).GetType.Name = "MyListItem" Then
|
||||
@@ -78,7 +81,7 @@ Public Class MyComboBox
|
||||
'WEnn die Items normale Strings beinhalten, wird keine Änderung des ._value Wertes vorgenommen.
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Catch ex As Exception
|
||||
' MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
|
||||
@@ -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