Ok so basically what I am trying to accomplish here is to count all of the characters in the richtextbox and show which of them are the vowels and it will constantly update and show the number of chars/vowels in the toolstrip bar. Pretty straightforward code but there seems to be some errors in the foreach loop and the textchanged. Would appreciate some feedback please :)
private void Form1_Load(object sender, EventArgs e)
{
int vowels;
int characters;
foreach(int char in rtbDoc)
{
characters+=1;
}
if (rtbDoc.Text == "a".ToLower() || rtbDoc.Text == "e".ToLower()
|| rtbDoc.Text == "i".ToLower() || rtbDoc.Text == "o".ToLower()
|| rtbDoc.Text == "u".ToLower())
{
vowels += 1;
}
toolStripStatusLabel1.TextChanged = characters +
"Characters, of which " + vowels + " are vowels";
}