Kundenanlage VERIMEX (AMVAR); cbo Erwe. hasItems

This commit is contained in:
2023-06-12 08:27:47 +02:00
parent 012e8b4996
commit 090b81ffb5
5 changed files with 63 additions and 0 deletions

View File

@@ -96,6 +96,38 @@ Public Class MyComboBox
Return False
End Function
Function hasItem(v) 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
For Each i In Me.Items
' MsgBox(DirectCast(i, MyListItem).Value & " - " & v)
If DirectCast(i, MyListItem).Value.ToUpper = CStr(v).ToUpper Then
'me.SelectedIndex = i : Return True
Return True
End If
Next
For Each i In Me.Items
' MsgBox(DirectCast(i, MyListItem).Value & " - " & v)
If DirectCast(i, MyListItem).Text.ToUpper = CStr(v).ToUpper Then
Return True
End If
Next
End If
Catch ex As Exception
' MsgBox(ex.Message)
End Try
Return False
End Function
Function getValueOfItem() As String
If Me.Items.Count = 0 Then Return ""
Try : Return DirectCast(MyBase.SelectedItem, MyListItem).Value