Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application is stealing focus 1

Status
Not open for further replies.

graabein

Programmer
Oct 9, 2002
186
NO
Hi, I have a strange behaviour in a timer event that refreshes the contents of a list.

Sometimes it steals the focus from other applications even though my app is "behind" the application the user is currently working on.

I assume this is because of the SetFocus method?

I use this to "reactivate" the control that had focus before the list was refreshed. Otherwise the user have to click back on the control for each refresh and that is annoying.

Before I SetFocus I check if Me.Name = Screen.ActiveForm.Name so this does not happen all the time, but sometimes it still jumps to the front!!?

I have checked and I do not have any other timers in my application that sets focus.

Are there other tests I can run before I do SetFocus to make sure my application is at the front and has user focus??

[elephant2]
graabein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top