I'm not sure I really get your problem.
Some possible clues:
if your button is the accept button of your form. Pressing enter is similar
to clocking on it. Something like that:
private void InitializeCompo nent()
{
...
this.AcceptButt on = this.button1; // this refers to the current
form
...
}
If you do want your button to accept the form, you should consider to set
these two Textbox properties to true:
this.textBox1.A cceptsReturn = true;
this.textBox1.M ultiline = true;
thus, when pressing enter and the textbox has focus, it will generate a
carriage return in the textbox.
Olivier DALET
-------------------
"REIVILONOSSALG " <an*******@disc ussions.microso ft.com> a écrit dans le
message de news:FA******** *************** ***********@mic rosoft.com...
How to prevent that the Button_Click event comes if one pressed Enter on
TextBox which has a valid event handler ?
Thanks for your response