点击button1 全选textbox1中的内容 C#的代码

private void button1_Click(object sender, EventArgs e)
{
textBox1.SelectAll();
}
为什么没有效果

private void button1_Click(object sender, EventArgs e)
{
//如果没有焦点,就不能选中
textBox1.Focus();
textBox1.SelectAll();
}
温馨提示:答案为网友推荐,仅供参考
相似回答