I'm trying to assign "tela[counter] = letra.ToString();", but it shows up the following error message "Property or indexer 'string.this[int] cannot be assigned to -- it is read only".
I saw some topics saying that you have to define {get;set;} to the atribute, but I've done this, and it didn't work.
[OBS] I tried to create get and set methods but the problem persisted
public String tela { get; set; }
private void btnSendWord_Click(object sender, EventArgs e)
{
char letra = Convert.ToChar(txtGetWord.Text);
MessageBox.Show(comboPalavra[0]);
Boolean codigoVerificador;
codigoVerificador = verificador.VerificaLetra(comboPalavra[0],letra);
if (codigoVerificador == true)
{
foreach(char c in comboPalavra[0].ToCharArray())
{
counter++;
if(c == letra)
{
tela[counter] = letra.ToString();
}
}
}
else MessageBox.Show("Nao contem");
}