WinForm移动光标到TextBox文本末尾

private void txtAmount_TextChanged(object sender, EventArgs e)
{
    TextBox box = sender as TextBox;
    if (box != null)
    {
        box.SelectionStart = box.TextLength;
        box.Focus(); //少了这句可能看不到效果
    }            
}


评论: 0 | 引用: 0 | 查看次数: 3236
发表评论
登录后再发表评论!