[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2009-07-06
3
Medium Priority
?
180 Views
Last Modified: 2013-12-17
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.

Thanks,
newbieweb
0
Comment
Question by:newbieweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
p_davis earned 2000 total points
ID: 24789168
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

etc.
0
 

Author Closing Comment

by:newbieweb
ID: 31600354
AWESOME! That fixed something which I think was otherwise un-fixable!

Thanks.
newbieweb
0
 
LVL 22

Expert Comment

by:p_davis
ID: 24793490
cool, glad that helped.

thanks for the points.

perry
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question