hi friend this example enough for you!!!
private void textBox1_TextChanged(object sender, EventArgs e)
{
MessageBox.Show("hello");
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
textBox1_TextChanged(this.textBox1, EventArgs.Empty);
}
else
{
this.textBox1.TextChanged -= new EventHandler(textBox1_TextChanged);
}
}
regards
sarva