Kundenanlage VERIMEX (AMVAR); cbo Erwe. hasItems
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user