木子屋 Dnawo's BLOG

WinForm移动光标到TextBox文本末尾

👤 dnawo 📅 2014-07-16 👁 4035 👍 0 💬 0 🔄 本站原创
private void txtAmount_TextChanged(object sender, EventArgs e)
{
    TextBox box = sender as TextBox;
    if (box != null)
    {
        box.SelectionStart = box.TextLength;
        box.Focus(); //少了这句可能看不到效果
    }            
}

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 一张图看懂中国茶分类 下一篇 → WinForm下载文件并显示下载进度示例