当前位置:编程学习 > C#/ASP.NET >>

WinForm 的TextBox 如何能让光标永远停留在最后一位字符的前面?

WinForm 的TextBox 如何能让光标永远停留在最后一位字符的前面?
例如:1234,就停留在4的前面 :123|4
怎样才可以达到这种效果? --------------------编程问答-------------------- 在获得焦点事件里写上
textBox1.Select(textBox1.Text.Lenth - 2, textBox1.Text.Lenth - 2); 
试试,我没试过,只提供意见
--------------------编程问答--------------------   this.textBox1.Select(this.textBox1.Text.Length-1,0); --------------------编程问答-------------------- up --------------------编程问答--------------------             if (this.textBox1.Text.Length > 0)
            {
                this.textBox1.SelectionStart = this.textBox1.Text.Length - 1;
                this.textBox1.SelectionLength = 0;
            }
            this.textBox1.Focus(); --------------------编程问答-------------------- 我自己去试一下大家发的这些代码,谢谢楼上的各位代码! --------------------编程问答-------------------- qiang
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,