Pregunta

In my application I use AlwaysOnTop = true setting for my Form object which at some points appears in the lower right corner.

I want to keep that appearing on top because it gives an important warning, but it is very annoying that the focus is also set to the form.

So when someone is doing something in another program he needs to click once on the application he is actually working in to regain focus from my notification form.

I couldn't find out a way of fixing it so hope someone can help.

Thank you very much !

¿Fue útil?

Solución

Here's an example of the API being used:

Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer

Private Const SW_SHOWNA As Integer = 8

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim frm As New someFormHere
    ShowWindow(frm.Handle, SW_SHOWNA)
End Sub
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top