Application Losing Focus when running from exe

  • Thread starter Thread starter William Kane
  • Start date Start date
W

William Kane

Hi,

I have a winforms app which, when run from the VS.NET
IDE, puts input focus on the startform as one would
expect.

However, when I run the exe directly, the main window
does not retain focus and I have to manually click on the
window to give focus to it.

Any explanations would be greatly appreciated.

Thanks
 
* "William Kane said:
I have a winforms app which, when run from the VS.NET
IDE, puts input focus on the startform as one would
expect.

However, when I run the exe directly, the main window
does not retain focus and I have to manually click on the
window to give focus to it.

How do you run it?

Does this only occur in this project or does that even occur with a
blank project with just 1 form?

Are you using any 3rd party components on the form?
 
Hi,

I run it by clicking the exe in windows explorer.
It doesn't occur in any other project.
Following is a list of controls used on that particular
form:
a. Labels (3)
b. Pictureboxes (1)
c. WebBrowser control (I have set Enabled = False for
this control. I am hosting a flash movie in this control)

There are no third party components on this form.

Just to reiterate, the form does get focus when I run
from the VS.NET 2003 IDE (Debug->Start option). It
doesn't retain focus when I double click the exe from
Windows Explorer or even from Start->Run->ApplicationPath.

I have put trace statements in the deactivate event of
this form. These don't fire even when running from the
exe directly.

Thanks for the prompt reply
 
Back
Top