• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

I need an event handler to "eat" the Enter event for a Windows TextBox

I have an event handler which gets called when the focus enters the control, using the Enter event. But in that event, depending on the value of some variable, I may need to set the focus somewhere else. The problem is that once my call to Focus() is called, the rest of the Enter event gets called and sets the focus to that control. But I want to the control on thecontrol where I call Focus().

Do you know how to eat the event so it will not get called?

I want to be able to call Enter for a TextBox control.

  • 2
1 Solution
i might not be understanding what you want but if you don't want the rest of the event code to fire after you set focus, in it, then you can just return out of the method

return; //if void

return someBoolValue; // if bool

newbiewebSr. Software EngineerAuthor Commented:
AWESOME! That fixed something which I think was otherwise un-fixable!

cool, glad that helped.

thanks for the points.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now