Hi guys! Can anyone please tell me why the code below is not working? Thanks!


private void tipoComboBox_SelectedValueChanged(object sender, EventArgs e)
{
if (tipoComboBox.SelectedIndex == 0)
{
string Str = valorTextBox.Text;
Str = Regex.Replace(Str, @"-", "");
valorTextBox.ForeColor = Color.Blue;
valorTextBox.Text = Str;
}

if (tipoComboBox.SelectedIndex == 1)
{
string Str = valorTextBox.Text;
Regex.Replace(Str, "R$", "-R$");
valorTextBox.ForeColor = Color.Red;
valorTextBox.Text = Str;
}
}