It depends on the control.
For a textbox, override OnKeyPress method like the following lines :
protected override void OnKeyPress(KeyPressEventArgs e) {
if ((int)e.KeyChar==13) e.Handled=true;
else base.OnKeyPress (e);
}
For a NumericUpDown control, use these lines :
protected override void OnTextBoxKeyPress(object source, KeyPressEventArgs
e) {
if ((int)e.KeyChar==13) e.Handled=true;
else base.OnKeyPress (e);
}
Hope it helps.
Ludovic SOEUR.