Option Explicit On
Public Class Form1
Public Function IsInArray(ByVal FindValue As Object, ByVal arrSearch As Object) As Boolean
On Error GoTo LocalError
If Not IsArray(arrSearch) Then Exit Function
If Not IsNumeric(FindValue) Then FindValue = UCase(FindValue)
IsInArray = InStr(1, vbNullChar & Join(arrSearch, vbNullChar) & vbNullChar, _
vbNullChar & FindValue & vbNullChar) > 0
Exit Function
LocalError:
'Justin (just in case)
End Function
Public Class Form1
Public Function IsInArray(ByVal FindValue As Object, ByVal arrSearch As Object) As Boolean
On Error GoTo LocalError
If Not IsArray(arrSearch) Then Exit Function
If Not IsNumeric(FindValue) Then FindValue = UCase(FindValue)
IsInArray = InStr(1, vbNullChar & Join(arrSearch, vbNullChar) & vbNullChar, _
vbNullChar & FindValue & vbNullChar) > 0
Exit Function
LocalError:
'Justin (just in case)
End Function
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Try
Dim mypoc() As String = {"色調", "飽和度計算", "mspaint", "calc", "notepad"}
Dim Shipping As String = TextBox1.Text
For Each a As String In mypoc
If Shipping = a Then
MsgBox("true")
End If
Next
Catch ex As Exception
End Try
End Sub
Dim mypoc() As String = {"色調", "飽和度計算", "mspaint", "calc", "notepad"}
Dim Shipping As String = TextBox1.Text
For Each a As String In mypoc
If Shipping = a Then
MsgBox("true")
End If
Next
Catch ex As Exception
End Try
End Sub
發表評論 評論 (0 個評論)