📅  最后修改于: 2022-03-11 14:48:46.904000             🧑  作者: Mango
public void textchange(object sender, EventArgs e)
{
if(textbox1.Text.Contains("$"))
{
string valueToConvert = textbox1.Text.replace("$","");
double newVal = Convert.ToDouble(valueToConvert);
//Assign the new value with $ to textbox1
textbox1.Text = "$"+Convert.ToString(newVal);
}
}