473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form Lost Focus

I have searched and searched, with no luck.

I have a Form that has several event listeners in it (Keypresses, speech
recognition, afew others). When I click a component in the form (such as a
button), the form itself loses focus.

How can I get it back? I have tried this.Focus() from w/in the form in a
timer with no luck as well as several other things.

Thanks!
Jun 27 '08 #1
3 2644
Hi Jesse,

I'm guessing you have some code that is causing the form to lose focus.
This code may well also preventing you from resetting it. Review your code
to see if there is any code that may do so, possibly with assistance of the
LostFocus event to determine when this happens.

--
Happy Coding!
Morten Wennevik [C# MVP]
"Jesse" wrote:
I have searched and searched, with no luck.

I have a Form that has several event listeners in it (Keypresses, speech
recognition, afew others). When I click a component in the form (such as a
button), the form itself loses focus.

How can I get it back? I have tried this.Focus() from w/in the form in a
timer with no luck as well as several other things.

Thanks!
Jun 27 '08 #2
Do you have anything in the Form Activate event? Try disabling all the form
events.

Cheers!

"Jesse" wrote:
I have searched and searched, with no luck.

I have a Form that has several event listeners in it (Keypresses, speech
recognition, afew others). When I click a component in the form (such as a
button), the form itself loses focus.

How can I get it back? I have tried this.Focus() from w/in the form in a
timer with no luck as well as several other things.

Thanks!
Jun 27 '08 #3
Jesse wrote:
I have searched and searched, with no luck.

I have a Form that has several event listeners in it (Keypresses,
speech recognition, afew others). When I click a component in the
form (such as a button), the form itself loses focus.

How can I get it back? I have tried this.Focus() from w/in the form
in a timer with no luck as well as several other things.
Instead of trying to make the Form regain focus, make the event handlers
work no matter what has focus.

Try this:
http://msdn2.microsoft.com/en-us/lib...agefilter.aspx
>
Thanks!

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Carl | last post by:
Hi, I have a from called frmBatchUpdate. On it I have created 10 text boxes in one column txtTRN1, txtTRN2 etc.. (Tenancy Reference Numbers) and another 10 to the right txtRPA1, txtRPA2 etc.....
2
by: Mark Ingram | last post by:
Hi, ive just had to make a Find dialog for an application and to get it in a similar style to the MS ones i have had to set the control style to TopMost so that i can move the caret around...
13
by: M O J O | last post by:
Hi, I need to create a popup form what will not steal focus. I've searched the net and I managed to put some code together. Below is the result of my code, but I have a single question .......
2
by: ghobley | last post by:
Hello, My application has 2 forms on display at one time. The form on the left contains a tree view which drives the contents of the form on the right. My problem is that I would like to capture...
0
by: Nick | last post by:
I have a situation wherein i have a text box, that has abc() being executed whenever the lost focus event is triggered. However, there is an exceptional case where, if a button click causes the...
4
by: easoftware | last post by:
I am using VS .Net 2003 and VB. I have an app with one parent and two Mdi child forms. I need to validate data in the Mdi form. The Form.Validating event works when I try to close a Mdi form,...
4
by: vandanasridhar | last post by:
Hi, its Vandana. I m a begginer of VB, Trying to create a form Having three command buttons Add, Modify, Exit. I made coding & it is running well, but technically not very sound. I use lost focus...
19
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But...
6
tuxalot
by: tuxalot | last post by:
braindead here...can't find a resolution to what should be a silly issue. I have a pop-up calendar form that I wish to close when the user clicks back on the main form of my app. I've tried...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.