Samantha22
Programmer
For practice, I'm trying to write an app that allows a user to enter alpha & numeric characters into textBox1. textBox2 returns those characters (from textbox1), but in ascii format.
I'm trying to use an if statement to test for a character and replace it with another, however, I'm having a problem. My code is:
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
textBox2.Text = textBox1.Text;
if ( textBox1.Text = 'a' )
textBox2.Text = 'Å' ;
}
The error returned is: Cannot implicitly convert type 'string' to 'bool'
I understand the error, but I do not know how to get around this. Any help in this problem is greatly appreciated.
I'm trying to use an if statement to test for a character and replace it with another, however, I'm having a problem. My code is:
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
textBox2.Text = textBox1.Text;
if ( textBox1.Text = 'a' )
textBox2.Text = 'Å' ;
}
The error returned is: Cannot implicitly convert type 'string' to 'bool'
I understand the error, but I do not know how to get around this. Any help in this problem is greatly appreciated.