return key

  • Thread starter Thread starter Gav
  • Start date Start date
G

Gav

Is there a way that I can control exactly what happens when the user presses
the return key in a TextBox?
 
inherite a class from text box and override the:

protected override bool HandleKeyPress(char ch){

}

Regards

Michael
 
Why you have to create a new class for every textbox? Just one, and after
that you can use it for every such a textbox, which Enter key you want to
control.

Sunny
 
But I want it to do something different depending on which Textbox they
press <enter> in... unless there is a way to pass the controls name with it
also or something like that.
 
pass the object, accept a sender parameter. Then cast the
object into a textbox and get its name.

hth
niv
 
Or, you may create a delegate for the method which will be invoked to do the
actions. and after that what you have to do is only to change where the
delegate points for every textbox you wish to handle.

Sunny
 
Thanks for the help all

Sunny said:
Or, you may create a delegate for the method which will be invoked to do the
actions. and after that what you have to do is only to change where the
delegate points for every textbox you wish to handle.

Sunny
 
Back
Top