On Jan 18, 10:49*am, NvrBst <nvr...@gmail.comwrote:
On Jan 17, 10:30*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Thu, 17 Jan 2008 22:17:28 -0800, NvrBst <nvr...@gmail.comwrote:
Is there a quick way to see if my application has focus?
Define "focus".
I've tried "this.Focused" but it doesn't return true if one of its
childen controls is what has focus (IE I just clicked a button to
check "this.Focused"). *If I run the "this.myBtn.Focused" as the
button click event then I get "true". *Ideally I would want something
like application.focused.
I see System.Windows.Window.IsActive, available in .NET 3.0 and later. *
Prior to that, I'm not sure you can do it from .NET. *You may have to use *
p/invoke to get at the unmanaged function.
Pete
Ah, Window.IsActive is exactly what I want thanks :)
NB- Hide quoted text -
- Show quoted text -
hehe another small question if possible. How exactly do I use the
Window.IsActive object? I've added the PresentationFramework.dll
reference to my application and can see the
"System.Windows.Window.IsActiveProperty", but this isn't what I want.
Basically, how do I get my application window using the
PresentationFramework? I see
"System.Windows.Window.GetWindow(System.Windows.Wi ndow.DependancyObject)",
but what is the DependancyObject that relates to my base applications
window?
Thanks, this is probably a basic question but I can't find any
examples of google using the .NET version of Window.IsActive.
NB