读书人

简单有关问题

发布时间: 2012-03-21 13:33:15 作者: rapoo

简单问题,求助 在线等!

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(".");

读书人网 >asp.net

热点推荐