Results 1 to 2 of 2

Thread: [RESOLVED] [2008] moving form topmost!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    Resolved [RESOLVED] [2008] moving form topmost!

    Hey guys. I have a form, no title bar, no control box, no border.

    Now what happens is that I've registered a system wide hotkey. A combination of "shift + U".

    Everything works. When the form has focus, the hotkey fires an event where i display a message box. But when I am on other window (lets say IE, or on the desktop), the hotkey STILL fires the event..

    BUT I need to know how to bring my form on top.

    This code works perfect but has a flaw (keep reading)

    vb.net Code:
    1. Public Delegate Sub moveTopMostInvoker()
    2.     Private Sub SystemWideHotkeyComponent1_HotkeyPressed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SystemWideHotkeyComponent1.HotkeyPressed
    3.         If Me.InvokeRequired Then
    4.             Me.Invoke(New moveTopMostInvoker(AddressOf moveTopMost))
    5.         Else
    6.             moveTopMost()
    7.         End If
    8.         MsgBox("haza")
    9.     End Sub
    10.  
    11.     Public Sub moveTopMost()
    12.         Me.TopMost = True
    13.         Me.Focus()
    14.     End Sub

    However, when the form goes on top obviously the topmost property is true and therefore it dosnt go back in the background.

    How can I make it so it comes up. Remember a event fires if my application is running regardless of whether it has focus or not.

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width