
c#中,我点击一个button按钮后,就向textbox里插入“hello”,怎么样在插入的同时使光标在“hello”的后面
3个回答
展开全部
textBox.AppendText("hello");
textBox.Focus();
textBox.SelectionStart = textBox.Text.Length;
textBox.Focus();
textBox.SelectionStart = textBox.Text.Length;
展开全部
在button按钮事件里写上一句
private void button_click(object sender,eventargs e)
{
textbox.text="hello";
textbox.focus();
}
private void button_click(object sender,eventargs e)
{
textbox.text="hello";
textbox.focus();
}
追问
没用的,我是要使光标显示在“hello”的后面,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
设置输入焦点
yourTextBoxName.focus();
yourTextBoxName.focus();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询