Re: Application Focus
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Thu, 17 Jan 2008 22:30:04 -0800
On Thu, 17 Jan 2008 22:17:28 -0800, NvrBst <nvrbst@xxxxxxxxx> wrote:
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
.
- Follow-Ups:
- Re: Application Focus
- From: NvrBst
- Re: Application Focus
- References:
- Application Focus
- From: NvrBst
- Application Focus
- Prev by Date: Re: Image has wrong colors
- Next by Date: Re: FindAncestor of Unknown Type
- Previous by thread: Application Focus
- Next by thread: Re: Application Focus
- Index(es):