日期:2014-05-18  浏览次数:20355 次

简单问题,求助 在线等!
C# code


private void txtInvoice_Cash_TextChanged(object sender, EventArgs e)
 {
       if (this.txtInvoice_Cash.Text.Length == 0)
          {
             this.txtInvoice_Cash.Text = "0.00";
           }

   //实现效果,当接收字符为.的时候,自动移动光标到文本框中最后一个点(.)后面的第一位0.
 }



------解决方案--------------------
textBox1.SelectionStart = textBox1.Text.LastIndexOf(".");