So im trying to get this code to work but its not returning any values for the If Like portion of the code. I have no idea why this is happening.
Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click
'display color button click event procedure should display the color of the item
'whos item number is entered by the user.
'all item numbers contain exactly seven characters
'all items are available in four colors: blue, green, red, and white.
'the fourth character in the item number indicates the items color
'as follows: B or b indicates blue etc
'if the item number does not contain 7 charactors OR
'if the forth character is not one of the valid color characters,
'the procedure should display the appropriate message
If txtItem.Text Like "###[bBgGrRrwW]###" Then
If txtItem.Text.Contains("bB") Then
lblColor.Text = "Blue"
ElseIf txtItem.Text.Contains("gG") Then
lblColor.Text = "Green"
ElseIf txtItem.Text.Contains("rR") Then
lblColor.Text = "Red"
ElseIf txtItem.Text.Contains("Ww") Then
lblColor.Text = "White"
End If
ElseIf txtItem.Text IsNot "###[bBgGrRwW]###" Then
MessageBox.Show("Bad Job", "Color Project", MessageBoxButtons.OKCancel,
MessageBoxIcon.Information)
End If
End Sub