winform文本框即输即选
private void textBox2_TextChanged( object sender, EventArgs e )
{
// 文本框即输即选方法一
//this.textBox2.SelectionStart = 0; 可省
this.textBox2.SelectAll();
}
private void textBox2_KeyDown( object sender, KeyEventArgs e )
{
this.textBox2.SelectionStart = this.textBox2.Text.Length;
}
private void textBox2_KeyUp( object sender, KeyEventArgs e )
{
// 文本框即输即选方法二
//this.textBox2.SelectionStart = 0; 可省
this.textBox2.SelectAll();
}
posted on 2008-09-02 00:24 VictorShan 阅读(493) 评论(0) 收藏 举报
浙公网安备 33010602011771号