Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am launching another application using microsoft.visualbasic.shell, and I am using a hotkey control that will register when a key is pressed. Now I need to return focus to my application when that key is pressed. The hotkey event does fire when the key is pressed but does not return focus to my application. How can I do this?

 

I am using VB.Net if that makes a difference in code.

 

Thanks,

 

LiQuiD8

Posted

got it.. all i had to do was [form].activate, although for anyone that needs it, i did have to check if the form was minimized, otherwise changing focus back to it crashed out. So I just did this:

 

If CurrentForm.WindowState = Windows.Forms.FormWindowState.Minimized Then
    CurrentForm.WindowState = Windows.Forms.FormWindowState.Normal
End If
CurrentForm.Activate()

 

LiQuiD8

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...