views:

161

answers:

3

When I have 2 apps open and one has the focus but I want to execute a command in the other app, it requires a click to regain focus and another to execute the command. Is there some good reason why I couldn't take focus on MouseOver? I'm working with a WPF app if that is pertinent. TIA

EDIT: Oddly enough the MouseOvers work without focus.

A: 

You can take focus on MouseOver manually

Trickster
Yes, but is there a good reason why I shouldn't? It seems like most apps behave this way. Is there a UI guideline that would make this rude/evil?
Brad
Its just a convention in windows. You can get utilities which make windows behave in a more X like fashion so that they grab focus automatically as you pass your mouse over them.
Jherico
well if it's your app for internal use only than just do what you want. If the program for public distribution i'd recommend to keep the defaults
Trickster
@Jherico: No need to get utilities - it's a configurable built-in Windows setting.
280Z28
well it maybe confusing. if a person move his mouse to click on 'Start' button but insted he actives your application it a bit wired.
Trickster
+2  A: 

The setting is configurable at a system-wide level. You should never ever override the user's current setting regarding this.

MS Windows Vista -- focus follows mouse (There's also a link on how to do it on XP.)

Edit: Normally, you can click a button on a form and both bring focus to the window and click it at the same time. The origins of the current setting "eating" the initial mouse click that brings focus to a window started as a fix to a bug in the Ribbon UI. The discussion is somewhere in this video: The Story of the Ribbon. Sorry I can't narrow it down more than that, but at least the video is a great insight and work watching - maybe you can send a message to Jensen Harris if you need a faster answer.

Edit 2: I just added a button to a WPF window, and I'm able to click it as long as I can see it - whether or not the window has focus.

280Z28
Outstanding video so far. As noted above, of course, you're right and thanks again!
Brad
+3  A: 

I would not recommend doing this. This is not a standard way of working in Windows, so you will confuse your users. People are used to clicking into an application (or tabbing) to provide focus.

However, this is a configurable setting via the Accessability Tools in Windows. It can be enabled by choosing "Activate a window by hovering over it with the mouse" globally. Let your users specify this behavior if they want it.

Reed Copsey
Thanks Reed (And everyone). Will do!
Brad