66问答网
所有问题
点击button1 全选textbox1中的内容 C#的代码
private void button1_Click(object sender, EventArgs e)
{
textBox1.SelectAll();
}
为什么没有效果
举报该问题
推荐答案 2016-07-19
private void button1_Click(object sender, EventArgs e)
{
//如果没有焦点,就不能选中
textBox1.Focus();
textBox1.SelectAll();
}
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://66.wendadaohang.com/zd/UsUpvnp2n9Dn2vixx99.html
相似回答
大家正在搜
相关问题
C#winform程序点击按钮文本框内容全选,并将光标置于文...
c#中在一个button事件,点击后要让另一个textbox...
c#中全选的代码怎么写?
C#里怎么将文本框里的内容全部选中
c# 对textbox控件的内容设置Ctrl+A全选
C#如何实现点击一次按钮让TextBox里面的内容更新多次?
C#中textbox1中输入的内容在表 shang 中查询,...
C#想要选项中所有文本,代码是? 用SelectAll; 文...