Hey guys,
I know this may be an easier one, but I'm completely lost. I have some of the program written but am stuck with the rest of it. Here is what I need the program to do. The stuff written so far may need to be scrapped because I'm completely lost.
There are checkboxes for the letters that need to be found (A, E, I, O, U, and ST). When a checkbox is selected I need for the program to find the number of those letters and then display the number in a label.
I have this written up for code so far, but I am lost with even if the code written is correct. I have no idea how to display the count of each individual letter in an individual box. I have also attached a screenshot of the interface to give you all a better idea of what I need.
http://i.imgur.com/nplWK.png
And here is my code (I apologize in advance for any stupid mistakes made):
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
Dim intText As Integer
Dim word As String
Dim sChar As String
Dim i As Integer
word = Me.txtScan.Text
If cbxWord.Checked = True Then
intText = txtScan.TextLength
lblWords.Text = intText.ToString("n0")
End If
Do While Boolean.TrueString
If cbxA.Checked = True Then
txtScan.Text.Contains("A, a")
End If
For i = 1 To Len(word)
sChar = LCase(Mid(word, i, 1))
If cbxA.Checked = True And sChar = "a" Then
intText = intText + 1
End If
Next i
For i = 1 To Len(word)
sChar = LCase(Mid(word, i, 1))
If cbxE.Checked = True And sChar = "e" Then
intText = intText + 1
End If
Next i
For i = 1 To Len(word)
sChar = LCase(Mid(word, i, 1))
If cbxI.Checked = True And sChar = "i" Then
intText = intText + 1
End If
Next i
For i = 1 To Len(word)
sChar = LCase(Mid(word, i, 1))
If cbxO.Checked = True And sChar = "o" Then
intText = intText + 1
End If
Next i
For i = 1 To Len(word)
sChar = LCase(Mid(word, i, 1))
If cbxU.Checked = True And sChar = "u" Then
intText = intText + 1
End If
Next i
For i = 1 To Len(word)
sChar = LCase(Mid(word, i, 1))
If cbxST.Checked = True And sChar = "st" Then
intText = intText + 1
End If
Next i
MsgBox("None Found" & intText)
Loop
End Sub
UPDATE Got it to work by putting a -1 next to For i = 1 To Len(word) and by deleting the loop. Thanks all for your help!!