

public void TextChanged()
{
Counter.Text = editor.Text.Length;
if ( editor.Text.Length < 60 )
Counter.forecolor = Color.Red;
else
Counter.forecolor = Color.Green;
}
public bool balanced(string text, char one, char two)
{
int[] Counter = { };
char[] Text = text.ToCharArray();
for ( int current = 0; current < text.Length; current++ )
{
if ( Text[current] == one )
Counter[0] += 1;
if ( Text[current] == two )
Counter[1] += 1;
}
if ( Counter[0] == Counter[1] )
return true;
else
return false;
}
public void TextChanged() { Counter.Text = editor.Text.Length; if ( editor.Text.Length < 60 ) Counter.forecolor = Color.Red; else Counter.forecolor = Color.Green; }
Also for the syntax you may find this script useful.
public bool balanced(string text, char one, char two) { int[] Counter = { }; char[] Text = text.ToCharArray(); for ( int current = 0; current < text.Length; current++ ) { if ( Text[current] == one ) Counter[0] += 1; if ( Text[current] == two ) Counter[1] += 1; } if ( Counter[0] == Counter[1] ) return true; else return false; }
I'll try it out.
label1.Text = richTextBox1.TextLength.ToString();
That's wrong, but I'm on my iPhone, and I can't remember the code. But it's very similar.
I'll try it out. Ummm. It might have been my old one. It's not hard to do.
label1.Text = richTextBox1.TextLength.ToString();
That's wrong, but I'm on my iPhone, and I can't remember the code. But it's very similar.
public void TextChanged()
{
Counter.Text = editor.Text.Length;
if ( editor.Text.Length < 60 )
Counter.forecolor = Color.Red;
else
Counter.forecolor = Color.Green;
}
public bool balanced(string text, char one, char two)
{
int[] Counter = { };
char[] Text = text.ToCharArray();
for ( int current = 0; current < text.Length; current++ )
{
if ( Text[current] == one )
Counter[0] += 1;
if ( Text[current] == two )
Counter[1] += 1;
}
if ( Counter[0] == Counter[1] )
return true;
else
return false;
}
private void textBox_TextChanged(object sender, EventArgs e)
{
Counter.Text = ""+textBox.Text.Length;
if (textBox.Text.Length < 60)
Counter.ForeColor = Color.Red;
else
Counter.ForeColor = Color.Green;
}
private void textBox_TextChanged(object sender, EventArgs e)
{
Counter.Text = ""+textBox.Text.Length;
if (textBox.Text.Length < 60)
Counter.ForeColor = Color.Red;
else
Counter.ForeColor = Color.Green;
}

label2.Text = "" + richTextBox1.Text.Length;
if (richTextBox1.Text.Length > 1000)
richTextBox1.BackColor = Color.Red;
Copyright © 2026, NextGenUpdate.
All Rights Reserved.