troubleshooting Question

Show form without losing focus on active window

Avatar of blitzzy
blitzzy asked on
Visual Basic Classic.NET ProgrammingVisual Basic.NET
9 Comments1 Solution6726 ViewsLast Modified:
I have an application written in VB.NET 2005 that has a main form with a datagridview containing information that is updated every 10 seconds and pops up a new form when certain thresholds have been met. This new, borderless form is like an alert that is displayed near the user's system tray.

My problem is that when this alert form is displayed, the form gets the main focus from whatever the user is doing at the time. For example, if the user is typing an e-mail in Outlook, the focus is transferred from Outlook to the popup.

How can I get my popup alert to be displayed as the TopMost form without interrupting the user? For instance, when a new e-mail is received, a popup is displayed in MSN Messenger but it doesn't take focus away from what the user is doing yet it still stays on top of all the forms.

I have tried overriding the ShowWithoutActivation property in .NET 2.0 but it doesn't seem to work.
Protected Overrides ReadOnly Property ShowWithoutActivation() As Boolean
        ' Gets a value indicating whether the window will be activated when shown
        Get
            ' Set to TRUE so the popup won't interrupt the user's work by taking 
            ' input focus away from the user's current window
            Return True
        End Get
    End Property
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros