Button按下ENTER時做的動作
private void Button1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (Char)Keys.Enter)
{
TextBox.Text = "";
}
}
TextBox內設定全選功能
private void TextBox_SelectAll(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Control && e.KeyCode == Keys.A)
{
(sender as TextBox).SelectAll();
}
}
沒有留言:
張貼留言