求助,c#计算器小数点出现在数字的前面
textbox的righttoleft的属性值是YES.
private void button11_Click(object sender, EventArgs e) { if (textBox1.Text.IndexOf('.')>0) { return; } textBox1.Text += '.'; }
问题如图:


继续输入 小数点会跑到后面

private void button11_Click(object sender, EventArgs e) { if (textBox1.Text.IndexOf('.')>0) { return; } textBox1.Text += '.'; }