textBox中已经有一些字符,光标停在这些字符中间,我想按“UP”键时,编辑框中的光标跑到最右边。我试过
textBox1.SelectionStart = textBox1.TextLength;
textBox1.SelectionLength = 0;
可是光标停在倒数第一个字符之前。请各位高手帮忙。问题解决立即散分。
textBox1.SelectionStart = textBox1.TextLength;
textBox1.SelectionLength = 0;
可是光标停在倒数第一个字符之前。请各位高手帮忙。问题解决立即散分。
{
if(e.KeyValue == 38)
{
textBox1.SelectionStart = textBox1.TextLength;
textBox1.SelectionLength = 0;
}
}我是这么写的
if(e.KeyValue == 38)
{
textBox1.Focus();
textBox1.SelectionStart = textBox1.TextLength;
textBox1.SelectionLength = 0;
}
To: honglin119
您的方法也是将插入焦点定位在倒数第一个字符之前。
To: twidtfdatao
您的方法把插入焦点放在了最左边。我想实现的是放在最右边还望各位帮忙了。