设置某个TextBox控件自动获取焦点,并且全选里面的内容。
private void but全选_Click(object sender, EventArgs e) { this.txtSqlResult.Focus(); this.txtSqlResult.Select(0, this.txtSqlResult.Text.Length); this.txtSqlResult.SelectAll(); }