Hello all,

I have a program where the main form is called (shown/activated) via a keystroke combination. When the form pops-up, I've set the focus to a textbox to begin typing right away.

When the keystroke event occurs, I have:

Me.Activate()

And in the Form_Activated event:

Textbox1.Focus()


Simple right? It works the way I want it to, even after I've compiled and run the EXE, but ONLY if Visual Studio 2008 is running. Once I close my project in VS, with the program still running outside VS, the form is shown, but input focus is not set to the textbox.

Input focus is however still set to whatever it was previously, like a word document for example. My form will be topmost, but if I attempt to input text, it would still be entered into the word doc.

Any ideas on why having my projects' source open in VS has anything to do with running the compiled EXE of said program?

I've even tried API calls to SetForegroundWindow and ShowWindow with the same result.